From: Ole Langbehn <ole@freiheit.com>
To: pgsql-performance@postgresql.org
Subject: Re: sequential scan on select distinct
Date: Wed, 6 Oct 2004 18:09:43 +0200
Message-ID: <200410061809.43549.ole@freiheit.com> (raw)
In-Reply-To: <opsff1mmp8cq72hf@musicbox>
References: <200410061130.58625.ole@freiheit.com>
<opsff1mmp8cq72hf@musicbox>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: ole@freiheit.com
Subject: Re: sequential scan on select distinct
In-Reply-To: <200410061809.43549.ole@freiheit.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox