neo4j/community — pull request #965 by systay (2012-11-03 15:40:52+00:00)
Title: Order by limit

When a query with both ORDER BY and LIMIT is encountered, Cypher now only keeps a limited set
of the input in heap. Before this commit, the whole input would be ordered, and then the top x
rows kept. Now, Cypher builds a buffer of the top x hits, that it keeps ordered. Really large
queries can now still be executed without leading to a OutOfMemoryError.

This PR builds on https://github.com/neo4j/community/pull/964