Re: A question on the query planner - Mailing list pgsql-performance

From Robert Treat
Subject Re: A question on the query planner
Date
Msg-id 1070385381.24915.8650.camel@camel
Whole thread Raw
In response to A question on the query planner  (Jared Carr <jared@89glass.com>)
Responses Re: A question on the query planner  (Jared Carr <jared@89glass.com>)
List pgsql-performance
On Mon, 2003-12-01 at 16:44, Jared Carr wrote:
> I am currently working on optimizing some fairly time consuming queries
> on a decently large
> dataset.
>
> The Following is the query in question.
>
> SELECT z.lat, z.lon, z.city, z.state, q.date_time, c.make, c.model, c.year
>     FROM quotes AS q, zips AS z, cars AS c
>         WHERE
>             z.zip = q.zip AND
>             c.car_id = q.car_id AND
>             z.state != 'AA' AND
>             z.state != 'AE' AND
>             z.state != 'AP' AND
>             z.state = 'WA'
>      ORDER BY date_time;
>

This wont completely solve your problem, but z.state = 'WA' would seem
to be mutually exclusive of the != AA|AE|AP.  While it's not much, it is
extra overhead there doesn't seem to be any need for...

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


pgsql-performance by date:

Previous
From: Greg Stark
Date:
Subject: Re: Update performance ... is 200,000 updates per hour what I should expect?
Next
From: Jared Carr
Date:
Subject: Re: A question on the query planner