-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Core
-
None
-
?
-
4402
-
Not Needed
Idea: We should optimize queries that use SORT followed by LIMIT.
The speed of queries with SORT + LIMIT is important, as it is often used to generate a presentation which has to fit in limited space, e.g. a screen.
The current implementation strictly searches, then sorts EVERYTHING FOUND, then returns the first LIMIT entries. We should change this to insertion during search into a sorted array / structure with room for only LIMIT entries. This can dramatically speed up SORT + LIMIT in cases where the search result is larger than LIMIT.