I previously added a comment on issue 99 about a quick tweak to the paging code and I didn't want it to go to waste. Changing the raw_rnum_ predicate from:
WHERE raw_rnum_ BETWEEN :low and :high
to: WHERE raw_rnum_ >= :low and rownum <= :limit
WHERE raw_rnum_ >= :low and rownum <= :limit
allows the optimizer to use the count stopkey optimization and return the same results noticeably quicker.
Here's the execution plan for my DB with the current code:
And with the changes:
I've had this change running for almost a month in a few of my apps on 11G as well as some test projects on XE and everything seems cool, maybe someone else could give it a try and see if they get the same results?
Add oracle paging optimization discussed in issue 99
Seems good. Thank you