Tech article
Can GROUP BY still be optimized after all these years?
Hacker News | Nov 3, 2026 | ntur1337
Automated excerpt
For example, "which 10 items have the most orders?": How do "regular" GROUP BYs run on analytical databases? If a partition contains 100 items with exactly 15 orders each, our pruning logic can’t skip it: the partition’s total is 1,500 orders, which exceeds our smallest TopK value - even though none of its individual groups comes close. Since no group’s count can exceed its slot’s total, we can safely prune a partition if every slot’s total is below the smallest value in our current TopK.
Selected automatically from source text; not independently written or fact-checked. Read the original for full context.