Re: How slow is DISTINCT?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Contzen <mcontzen(at)dohle(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How slow is DISTINCT?
Date: 2002-04-15 14:49:32
Message-ID: 22990.1018882172@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Michael Contzen <mcontzen(at)dohle(dot)com> writes:
> Does postgres sort the whole table without projection to one column an
> performs a unique on this whole table?

No, it only sorts the column(s) being selected.

My guess is that your performance problem comes from using "numeric"
datatype. Consider int or bigint instead of numeric(10,0).

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Roberto Mello 2002-04-15 15:23:29 Re: Thank you ! Re: Is there any Faster workaround ??
Previous Message Tom Lane 2002-04-15 14:35:25 Re: case statement in group by clause