DocumentDB 0.116 Adds Distinct Scan for $group Queries, Cutting Index Reads Sharply
DocumentDB 0.116, released on August 20, 2026, introduces a distinct scan optimization for MongoDB-style $group aggregation queries running on its PostgreSQL extension. Instead of scanning all index entries and discarding duplicates, the new path jumps directly between distinct key values, reducing index reads from 50,000 entries to just 100 in a test dataset. The feature, called enableGroupByDistinctScan, is disabled by default and must be explicitly enabled via a system setting. DocumentDB is an open-source PostgreSQL extension that implements the MongoDB API, with Microsoft as its primary contributor through feedback from Azure DocumentDB enterprise users. The optimization builds on the same loose-index-scan principle previously applied to MongoDB's DISTINCT_SCAN for first- and last-per-group queries.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in