| ▲ | Postgres SELECT DISTINCT Does Not Scale(dbos.dev) | |||||||
| 13 points by KraftyOne a day ago | 3 comments | ||||||||
| ▲ | nattaylor 3 minutes ago | parent | next [-] | |||||||
Loose index scan is made for this https://dev.mysql.com/doc/refman/8.0/en/group-by-optimizatio... Postgres doesn't have it yet https://wiki.postgresql.org/wiki/Loose_indexscan | ||||||||
| ▲ | DiabloD3 32 minutes ago | parent | prev [-] | |||||||
"Postgres SELECT DISTINCT Does Not Scale" Correct. This is documented in depth: DISTINCT sorts the results first. The article's use case seems to imply the author did not know about GROUP BY, nor does it imply the author knew about indexes, nor ANALYZE. Postgres 18's new skip scan indexing also could help here, so ensuring the planner chooses that could help. | ||||||||
| ||||||||