Closed meaningg closed 1 year ago
It's a bit hard to say without the rest of your code, but if you are using sort
in combination with take
and skip
, it will first need to determine which nodes should be loaded for the result set. If you have no index on the target sort column(s), it needs to perform a "table scan" to read all sort column(s) values. Then, it will read all requested data from nodes that are in the take
/ skip
window: those records will have effectively been read twice.
Without sort
, using take
/ skip
is a as easy as just skipping n child nodes, then reading m nodes once
Yes, I use a combination of .sort and .take. Now that explains it all. Thank you!
.sort causes each item to be read from the database a second time - is it okay ?
with .sort
without .sort