From: Kevin Brown <kevin@sysexperts.com>
To: pgsql-performance@postgresql.org
Subject: Re: Overriding the optimizer
Date: Thu, 15 Dec 2005 21:48:55 -0800
Message-ID: <20051216054855.GD691@filer> (raw)
In-Reply-To: <43A25372.8090706@modgraph-usa.com>
References: <7484.1134600423@sss.pgh.pa.us>
<1134629567.14248.27.camel@firebolt>
<200512150148.16125.blargity@gmail.com>
<1134644526.14248.60.camel@firebolt>
<43A1C40D.8040006@paradise.net.nz>
<43A1F6DB.3080805@modgraph-usa.com>
<43A226E7.7040508@paradise.net.nz>
<43A22BE3.6020103@modgraph-usa.com>
<20051216052025.GB691@filer>
<43A25372.8090706@modgraph-usa.com>
Craig A. James wrote:
> Kevin Brown wrote:
> >>Hints are dangerous, and I consider them a last resort.
> >
> >If you consider them a last resort, then why do you consider them to
> >be a better alternative than a workaround such as turning off
> >enable_seqscan, when all the other tradeoffs are considered?
>
> If I understand enable_seqscan, it's an all-or-nothing affair. Turning it
> off turns it off for the whole database, right? The same is true of all
> of the planner-tuning parameters in the postgres conf file.
Nope. What's in the conf file are the defaults. You can change them
on a per-connection basis, via the SET command. Thus, before doing
your problematic query:
SET enable_seqscan = off;
and then, after your query is done,
SET enable_seqscan = on;
> >If your argument is that planner hints would give you finer grained
> >control, then the question is whether you'd rather the developers
> >spend their time implementing planner hints or improving the planner.
>
> I agree 100% -- I'd much prefer a better planner. But when it comes down
> to a do-or-die situation, you need a hack, some sort of workaround, to get
> you working *today*.
And that's why I was asking about workarounds versus planner hints. I
expect that the situations in which the planner gets things wrong
*and* where there's no workaround are very rare indeed.
--
Kevin Brown kevin@sysexperts.com
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: kevin@sysexperts.com
Subject: Re: Overriding the optimizer
In-Reply-To: <20051216054855.GD691@filer>
* 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