Re: How slow is DISTINCT? - Mailing list pgsql-sql

From Tom Lane
Subject Re: How slow is DISTINCT?
Date
Msg-id 22990.1018882172@sss.pgh.pa.us
Whole thread Raw
In response to Re: How slow is DISTINCT?  (Michael Contzen <mcontzen@dohle.com>)
List pgsql-sql
Michael Contzen <mcontzen@dohle.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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: case statement in group by clause
Next
From: Roberto Mello
Date:
Subject: Re: Thank you ! Re: Is there any Faster workaround ??