pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: theo@flame.co.za
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizer : query rewrite and execution plan ?
Date: Wed, 06 Feb 2008 11:00:26 -0500
Message-ID: <9924.1202313626@sss.pgh.pa.us> (raw)
In-Reply-To: <1202299962.4274.22.camel@localhost6.localdomain6>
References: <60F4687513E90748AE8933DEA5D054E79ACBDE@SLAM0018.match-supermarket.com>
	<1202298826.4252.972.camel@ebony.site>
	<1202299962.4274.22.camel@localhost6.localdomain6>

Theo Kramer <theo@flame.co.za> writes:
> On Wed, 2008-02-06 at 11:53 +0000, Simon Riggs wrote:
>> Since the SQL is not your fault and difficult to control, it is an
>> argument in favour of an optional planner mode that would perform
>> additional checks for redundant clauses of various kinds. The default
>> for that would be "off" since most people don't suffer from this
>> problem. BO isn't the only SQL generating-client out there, so I think
>> this is a fairly wide problem.

> I would have to disagree. I spend a lot of time writing code that
> generates SQL from a business app and feel strongly that any
> optimisation is my responsibility.

Disagree with what?  If that's your feeling then you'd leave the setting
"off", and no harm done.

We used to have code that removed duplicate WHERE clauses (check the
revision history for prepqual.c).  It was taken out because it consumed
excessive amounts of planning time without accomplishing a darn thing
for most queries.  There is no chance that it will be put back in as the
only behavior, or even the default behavior, but I can see the reasoning
for offering an option as Simon suggests.

			regards, tom lane



view thread (12+ messages)  latest in thread

Message-ID: <9924.1202313626@sss.pgh.pa.us>
Permalink:  ../9924.1202313626@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9924.1202313626@sss.pgh.pa.us

 · 

reply

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, theo@flame.co.za
  Subject: Re: Optimizer : query rewrite and execution plan ?
  In-Reply-To: <9924.1202313626@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