Postgres SELECT DISTINCT Does Not Scale

Postgres SELECT DISTINCT Does Not Scale

A discussion on Hacker News highlights scalability problems with PostgreSQL’s SELECT DISTINCT clause. Users report that queries using DISTINCT can become extremely slow on large tables, often due to full scans and sorting. The thread suggests alternatives such as GROUP BY, using appropriate indexes, or redesigning schemas to avoid the need for distinct results. Performance testing and query planning tips are shared.

Postgres SELECT DISTINCT Does Not Scale — PinBrief