Tune a Leaderboard Query by Matching Filter, Rank, and Access Path
Optimize a ranked leaderboard query by shrinking the candidate set early and supporting the required order.
You need the top 50 creators by weekly revenue for one region, but the current plan ranks too many rows and spends heavily on sort work. Filter the peer set early, aggregate only what the leaderboard truly needs, rank inside that reduced set, and support the filtered order with the right multicolumn index. The trap is ranking a broad global dataset and trusting outer filters or LIMIT to make the work cheap after the fact. Step 1 Push the region predicate and week window into the earliest scan or pre-aggregation stage so the input represents only the peer group that…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in