From: Shaun Thomas <sthomas@leapfrogonline.com>
To: pgsql-performance@postgresql.org
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Date: Mon, 16 Oct 2006 17:28:42 -0500
Message-ID: <200610161728.43193.sthomas@leapfrogonline.com> (raw)
In-Reply-To: <eh0u34$cou$1@news.hub.org>
References: <eft782$5a1$1@news.hub.org>
<b42b73150610161407l55e66854g94b31de6dd511f16@mail.gmail.com>
<eh0u34$cou$1@news.hub.org>
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
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: sthomas@leapfrogonline.com
Subject: Re: Performance Optimization for Dummies 2 - the SQL
In-Reply-To: <200610161728.43193.sthomas@leapfrogonline.com>
* 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