Ordered DISTINCT ON and UNION DISTINCT ON
Extend DISTINCT ON with inline tie-breaking and apply keyed deduplication to UNION. In recursive CTEs, retain the best row per key as better candidates are found, enabling shortest-path and other state-space searches.
Versions
- PostgreSQL 20 · worked-on · improved · major
- PostgreSQL 17 · worked-on · improved · moderate