                            (r/get-field :bookmarked-at)
                            (r/default nil))}))
         ;; Filter out:
-        (r/filter query (r/fn [row]
-          (r/or (r/not start)
-                (r/and (= direction :before)
-                       (r/gt start (r/get-field row :sort-value)))
-                (r/and (= direction :after)
-                       (r/le start (r/get-field row :sort-value))))))
+        (if start
+          (r/filter query (r/fn [row]
+            ;; All records after/before the start
+            (direction-filter direction start (r/get-field row :sort-value))))
+          query)
         (if-not count?
           (r/order-by query (order-fn :sort-value))
           query)

      (as-> (r/table table-name) query
        (r/get-all query index-value {:index index-name})
           ;; Filter out:
        (r/filter query (r/fn [row]
          (r/or (r/not start)
                (r/and (= direction :before)
                        (r/gt start (r/get-field row :published-at)))
                (r/and (= direction :after)
                      (r/le start (r/get-field row :published-at))))))
        (if-not count?
          (r/order-by query (order-fn :published-at))
          query)

             (coll? relation-fields))
         (boolean? count?)
         (boolean? unseen)]}
  (let [order-fn (if (= order :desc) r/desc r/asc)
        dir-filter (when start
                     #(direction-filter direction start (r/get-field % [:reduction :created-at])))
        uns-filter (when (and unseen container-last-seen-at)
                      #(unseen-filter container-last-seen-at (r/get-field % [:reduction :created-at])))
        filter? (or dir-filter uns-filter)]
    (db-common/with-timeout db-common/default-timeout
      (as-> (r/table :interactions) query
        (r/get-all query index-value {:index index-name})
        (r/group query :resource-uuid)
        (r/max query :created-at)
        (r/ungroup query)
        (if filter?
          (r/filter query (r/fn [row]
            ;; All records after/before the start
            (cond (and dir-filter uns-filter)
                  (r/and (dir-filter row)
                         (uns-filter row))
                  dir-filter
                  (dir-filter row)
                  uns-filter
                  (uns-filter row))))
          query)
        ;; Join with the relative entry
        (r/eq-join query :group  ;; {:left {:group "resource-uuid" :reduction comment-map} :right entry-map}
          (r/table :entries))
        ;; Filter out items the user is not following
        (r/filter query (r/fn [row]
          ;; Filter on the user's visibility map:
          (user-visibility-filter user-id (r/get-field row :right))))
        ;; Sort
        (if-not count?
          (r/order-by query (order-fn (r/fn [row] (r/get-field row [:left :reduction :created-at]))))
          query)
        ;; Apply limit
        (if (pos? limit)
          (r/limit query limit)
