You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EPIC] A collection of Sort + Limit / Top K optimizations #7195
Is your feature request related to a problem or challenge?
This ticket has links a collection of various ways to make queries with LIMIT or various other variants (like row_number() predicates) both:
Go faster
Use less memory
These are typically called "Top K" style optimizations in databases and optimize the pattern of a sort followed by a limit
LIMIT(fetch = 10)
SORT(x)
INPUT...
The observation is that if the INPUT is much larger than the fetch (aka the K) it is much more efficient and less memory intensive to track the top 10 values rather than sort the entire input and discard everything except the top 10
Normally this done with special ExecutionPlan operators. What the operators do and behave depend on the exact query pattern.
changed the title [-][EPIC] A collection of Top K / LIMIT optimizations[/-][+][EPIC] A collection of `Sort + Limit` / `Top K` optimizations[/+]on Aug 4, 2023
Activity
[-][EPIC] A collection of Top K / LIMIT optimizations[/-][+][EPIC] A collection of `Sort + Limit` / `Top K` optimizations[/+]