From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Philip Molter <philip(at)datafoundry(dot)net> |
Cc: | Sam Tregar <sam(at)tregar(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Determining scan types |
Date: | 2001-07-04 06:31:53 |
Message-ID: | 3B42B859.52D7405D@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Philip Molter wrote:
> : For the purposes of setting SEQSCAN try something like:
> :
> : SET ENABLE_SEQSCAN TO OFF;
>
> Well, I turned it off for the entire database (since right now, we're
> only using the db for this one application), but I lose the benefit of
> seqscans in situations where it's appropriate. That's why I was
> wondering if there's anyway to tell the optimizer to prefer index scans
> over sequential scans when it has a choice.
AFAIK that's exactly what ENABLE_SEQSCAN does.
> Right now, it's using less
> efficient joining methods where it would normally use sequential scans
> (not that I'm complaining too much; CPU performance has more than
> doubled since taking out sequential scans).
Try wrapping the one or two key queries with ...OFF and ...ON - should
give you the best of both worlds.
I've always managed to persuade PG to make the "right" choices, but
there are a whole set of parameters you can tweak if absolutely
necessary. The ENABLE_SEQSCAN is a pretty blunt tool but is the easiest
for (me :-) to understand. See the runtime configuration chapter for
details and check the mail archives for examples of use.
- Richard Huxton
From | Date | Subject | |
---|---|---|---|
Next Message | Vijayan | 2001-07-04 07:23:19 | Please help! |
Previous Message | Martijn van Oosterhout | 2001-07-04 05:25:16 | Please add to TODO list |