space for optimalization: DISTINCT without index

From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: space for optimalization: DISTINCT without index
Date: 2005-12-12 17:35:07
Message-ID: BAY20-F59CECE51E0306DA4DE864F9460@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I did some test and I can see so DISTINCT works well on indexed columns, but
is slow on derived tables without indexes. If I use without distinct group
by I get much better times.

SELECT DISTINCT a, b FROM tab
SELECT a,b FROM tab GROUP BY a, b.

Can You Explain it.

Thank You
Pavel Stehule

_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
http://www.msn.cz/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-12 17:51:47 Re: pg_relation_size locking
Previous Message Qingqing Zhou 2005-12-12 17:32:14 Re: Which qsort is used