Re: [SQL] performance comparison: DISTINCT and GROUP BY

2002-08-19 Thread Christopher Kings-Lynne
Hi Devrim, You can use the EXPLAIN ANALYZE syntax to find out quite easily. Chris - Original Message - From: "Devrim GUNDUZ" <[EMAIL PROTECTED]> To: "PostgreSQL Mailing Lists-SQL" <[EMAIL PROTECTED]> Sent: Monday, August 19, 2002 7:22 PM Subject: [SQL]

[SQL] performance comparison: DISTINCT and GROUP BY

2002-08-19 Thread Devrim GUNDUZ
Hi, We have two different queries: SELECT name,surname FROM my_table GROUP BY name; and SELECT DISTINCT on(name) name,surname * FROM my_table; which gives us the same result. Do these queries differ by their performances? I mean, which one works faster? DISTINCT or GROUP BY? Best rega