Christophe Pettus: All Your GUCs in a Row: enable_distinct_reordering and enable_group_by_reordering (opens in new tab)
Reorder GROUP BY and DISTINCT keys to cut comparison costs and skip sorts—new optimizations in PostgreSQL 17 and 18 that usually stay invisible but…
Read the original article