Re: Performance Optimization for Dummies 2 - the SQL

From: Shaun Thomas <sthomas(at)leapfrogonline(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Date: 2006-10-16 22:28:42
Message-ID: 200610161728.43193.sthomas@leapfrogonline.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Monday 16 October 2006 16:37, Carlo Stonebanks wrote:

> The facility_address_id is null statement is necessary, as this is a
> sub-query from a union clause and I want to optimise the query with
> the original logic intact. The value is not hard coded to true but
> rather to null.

Heh, you neglect to mention that this query is discovering faculty who
do *not* have an address entry, which makes the "is null" a major
necessity. With that, how did a "not exists (blabla faculty_address
blabla)" subquery to get the same effect treat you? How about an "IN
(blabla LIMIT 1)" ?

--

Shaun Thomas
Database Administrator

Leapfrog Online
807 Greenwood Street
Evanston, IL 60201
Tel. 847-440-8253
Fax. 847-570-5750
www.leapfrogonline.com

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Carlo Stonebanks 2006-10-17 06:39:24 Re: Performance Optimization for Dummies 2 - the SQL
Previous Message Carlo Stonebanks 2006-10-16 21:56:54 Re: Performance Optimization for Dummies 2 - the SQL