J
jeremy
Text
EXPLAIN ANALYZE: The Hidden Cost of DISTINCT
This page explains what really happens when you add DISTINCT to a SQL query. The database has to collect every row the query produces and then remove duplicates, usually by sorting them or building a…