Re: sequential scan on select distinct - Mailing list pgsql-performance

From Ole Langbehn
Subject Re: sequential scan on select distinct
Date
Msg-id 200410061809.43549.ole@freiheit.com
Whole thread Raw
In response to Re: sequential scan on select distinct  (Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>)
List pgsql-performance
Am Mittwoch, 6. Oktober 2004 12:19 schrieb Pierre-Frédéric Caillaud:
>  You could try :
>
>  explain analyze select "land" from "customer_dim" group by "land";
>  It will be a lot faster but I can't make it use the index on my machine...
this already speeds up my queries to about 1/4th of the time, which is about
the range of mysql and oracle.
>
>  Example :
>
> [..]
>
>  Hum hum ! Again, a lot better !
>  Index scan backwards seems a lot faster than index scan forwards. Why, I
> don't know, but here you go from 15 seconds to 14 milliseconds...
thanks for this very extensive answer, it helped me a lot.
>
>  I don't know WHY (oh why) postgres does not use this kind of strategy
> when distinct'ing an indexed field... Anybody got an idea ?
That's the big question I still would like to see answered too. Can anyone
tell us?

TiA
--
Ole Langbehn

pgsql-performance by date:

Previous
From: Bill Montgomery
Date:
Subject: Re: Excessive context switching on SMP Xeons
Next
From: Greg Stark
Date:
Subject: Re: sequential scan on select distinct