Presorted aggregates
Planner providing presorted input to ORDER BY and DISTINCT aggregates instead of sorting inside the aggregate.
Versions
- PostgreSQL 20 · worked-on · improved · moderate
Threads
- [PATCH 0/1] Put presorted aggregate sort keys first in Aggregate
- BUG #19804: "variable not found in subplan target list", DISTINCT agg over Gather`
- Error when using array_agg with filter where clause in pg16 and pg17
- pg16: XX000: could not find pathkey item to sort
- BUG #18272: ERROR XX000 when selecting string_agg with distinct and subquery - occur in pg16.1 and not in pg15.4
- BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type
- Bugreport: incorrect result in 16.1 in query with string_agg(distinct+json_build_object
- Add proper planner support for ORDER BY / DISTINCT aggregates