Re: ISNULL performance tweaks - Mailing list pgsql-performance

From Josh Berkus
Subject Re: ISNULL performance tweaks
Date
Msg-id 200303061104.33335.josh@agliodbs.com
Whole thread Raw
In response to ISNULL performance tweaks  (Matt Mello <alien@spaceship.com>)
List pgsql-performance
Matt,

> I recall seeing an email (I believe on this list) about how to improve
> performance of ISNULL's with some sort of tweak or trick.  However, I
> can't find that email anywhere, and couldn't find it searching the
> maillist archives.

Easy.  Create a partial index on NULLs:

CREATE INDEX idx_tablename_nulls ON tablename(columname)
WHERE columname IS NULL;

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-performance by date:

Previous
From: Matt Mello
Date:
Subject: ISNULL performance tweaks
Next
From: Josh Berkus
Date:
Subject: Re: ISNULL performance tweaks