Re: Optimizing queries

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Patrice Beliveau <pbeliveau(at)avior(dot)ca>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimizing queries
Date: 2006-10-02 16:08:20
Message-ID: 1159805300.2659.196.camel@holly
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, 2006-08-08 at 16:42 -0400, Tom Lane wrote:
> Patrice Beliveau <pbeliveau(at)avior(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Simon Riggs 2006-10-02 16:25:13 Re: archive wal's failure and load increase.
Previous Message Marcelo Costa 2006-10-02 15:49:55 How much memory in 32 bits Architecture to Shared Buffers is Possible