So If I get it right, when I use [position() = 1 to 100], only the first 100 results are calculated? or all 900.000 rows are calculated, and I get the first 100 results? (imagine it is a complex query)
All <parent> elements will be created, but only the first 100 will need to be cached in the GUI.
I agree there might be some chance for further optimizations here. Volunteers are welcome!