DoltHub Blog
Read post

No Index GroupBy Optimization

Dolt and Doltgres were using a secondary index for GROUP BY queries even when a full table scan would be faster. By analyzing EXPLAIN output and flame graphs, the team discovered that when a filter selects more than ~50% of rows, the secondary index lookup overhead outweighs its benefits. They added heuristics to the query coster: secondary indexes are only preferred when they select fewer than 25% of rows, while primary keys and covering indexes are always preferred. Using existing statistics histograms to estimate filter selectivity, this reduced groupby_scan latency by 57% on Dolt (144ms → 62ms) and 44% on Doltgres (147ms → 83ms), making Dolt faster than MySQL on this benchmark.

    #database#postgresql
Aug 03•6m read time•From dolthub.com
Post cover image
Table of contents
Discovering the Optimization #Optimization #Conclusion #
35.5K Impressions
DoltHub Blog's image
DoltHub Blog

10 Followers

•

191 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard