Another DocumentDB for PostgreSQL optimization by Microsoft: pushing the $sort into the $group accumulator, so groups stream directly from the index lnkd.in/p/ewAiFyEa
lnkd.in
DocumentDB 0.116: $sort $group prefix pushdown
A common MongoDB pattern: $sort by a key, $group by the same key, and take the $first value per group. With an index on that key, the rows already arrive in the right order. You don't want to sort or ...