Remix.run Logo
asddubs 2 days ago

no, because it has to count the amount of matching rows preceding the offset rows to determine the offset, i.e. iterate over all preceding rows. The cursor provides a starting point for the offset so in this instance it's not necessary.

https://use-the-index-luke.com/sql/partial-results/fetch-nex...

Joker_vD 2 days ago | parent [-]

It only has to count if the index doesn't store the amounts of records in the "chunks" it manages, does it? I'm pretty sure B-trees do actually store the sizes of the subtrees.