pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Patrice Beliveau <pbeliveau@avior.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizing queries
Date: Mon, 02 Oct 2006 17:08:20 +0100
Message-ID: <1159805300.2659.196.camel@holly> (raw)
In-Reply-To: <13030.1155069749@sss.pgh.pa.us>
References: <44D8CE92.1080407@avior.ca>
	<1155062399.20252.50.camel@state.g2switchworks.com>
	<44D8F0B8.2030804@avior.ca>
	<13030.1155069749@sss.pgh.pa.us>

On Tue, 2006-08-08 at 16:42 -0400, Tom Lane wrote:
> Patrice Beliveau <pbeliveau@avior.ca> writes:
> >>> SELECT * FROM TABLE
> >>> WHERE TABLE.COLUMN1=something
> >>> AND TABLE.COLUMN2=somethingelse
> >>> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0;
> 
> > I find out that the function process every row even if the row should be 
> > rejected as per the first or the second condition.
> > ... I'm using version 8.1.3
> 
> PG 8.1 will not reorder WHERE clauses for a single table unless it has
> some specific reason to do so (and AFAICT no version back to 7.0 or so
> has done so either...)  So there's something you are not telling us that
> is relevant.  Let's see the exact table schema (psql \d output is good),
> the exact query, and EXPLAIN output for that query.

Is WHERE clause re-ordering done for 8.2, or is that still a TODO item?
(Don't remember seeing that at all).

-- 
  Simon Riggs             
  EnterpriseDB   http://www.enterprisedb.com




view thread (9+ messages)

Message-ID: <1159805300.2659.196.camel@holly>
Permalink:  ../1159805300.2659.196.camel@holly/
Also on:    postgresql.org/message-id/1159805300.2659.196.camel@holly

 · 

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: simon@2ndquadrant.com, tgl@sss.pgh.pa.us, pbeliveau@avior.ca
  Subject: Re: Optimizing queries
  In-Reply-To: <1159805300.2659.196.camel@holly>

* 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