Your understanding is generally correct. The inner rownum <= end
will "interrupt" the inner query once it has produced end
rows, and the outer rownum >= start
discards the first rows.
rownum
is generated on the fly, and the optimizer knows about rownum <
filters, so it can influence the row source and stop it short (look for COUNT STOPKEY
lines in the explain plan, that's what you'll see if it works).
But there is no guarantee that the inner select will be stopped short. In particular, an order by
clause in there might force the whole resultset to be generated, and then the rownum
filters simply discard the generated rows outside that interval.