mysema/querydsl — pull request #515 by oehme (2013-10-02 17:18:05+00:00)
Title: Oracle paging performance fix

Yeah, it's Oracle again ;)

I have changed the limitOffsetTemplate to use "rownum" instead of "rn" for limiting the number of results. You only need "rn" for the offset.

Without this fix, Oracle will for some reason scan the whole result instead of stopping after n rows. So this drastically improves performance for pages in the front of the result set while it is just as slow on the last page.

I tried it today with 500,000 rows and a page size of 400. Fetching the first page dropped from 1.5s to 0.3s