From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steinar H. Gunderson <sgunderson@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Weird performance drop after VACUUM
Date: Sat, 27 Aug 2005 11:40:42 -0400
Message-ID: <1638.1125157242@sss.pgh.pa.us> (raw)
In-Reply-To: <20050827152603.GF17097@uio.no>
References: <1125093859.9329.30.camel@localhost.localdomain>
<26745.1125099111@sss.pgh.pa.us>
<20050827101945.GA18155@uio.no>
<1404.1125155101@sss.pgh.pa.us>
<20050827152603.GF17097@uio.no>
"Steinar H. Gunderson" <sgunderson@bigfoot.com> writes:
> On Sat, Aug 27, 2005 at 11:05:01AM -0400, Tom Lane wrote:
>> It could, but it doesn't really have enough information. We don't
>> currently have any model that some operators are more expensive than
>> others. IIRC the only sort of reordering the current code will do
>> in a filter condition list is to push clauses involving sub-SELECTs
>> to the end.
> I was more thinking along the lines of reordering "a AND/OR b" to "b AND/OR
> a" if b has lower selectivity than a.
Yeah, but if b is considerably more expensive to evaluate than a, that
could still be a net loss. To do it correctly you really need to trade
off cost of evaluation against selectivity, and the planner currently
only knows something about the latter (and all too often, not enough :-().
I'd like to do this someday, but until we get some cost info in there
I think it'd be a mistake to do much re-ordering of conditions.
Currently the SQL programmer can determine what happens by writing his
query carefully --- if we reorder based on selectivity only, we could
make things worse, and there'd be no way to override it.
regards, tom lane
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: tgl@sss.pgh.pa.us, sgunderson@bigfoot.com
Subject: Re: Weird performance drop after VACUUM
In-Reply-To: <1638.1125157242@sss.pgh.pa.us>
* 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