Do we really need to perform 2 queries when doing pagination:
- to get the total count
- to get the actual result with ORDER BY and SKIP / LIMIT
MATCH (u:User) WHERE ... RETURN u ORDER BY u.username SKIP 100 LIMIT 25
already has to get all the (filtered) nodes, sort them, then return just the nodes of the "page" (SKIP/LIMIT) as shown by a
I - and possibly millions of other users out there - ALWAYS need to show the total count of matching nodes to the user ... which is the number of rows after the (last) Filter step (4099 in this case).
Wouldn't it be possible for the DB to return this count as part of the query-stats?
Or is this possible with some secret parameter already?
Or is there a performant workaround that I am unaware of?