Re: ISNULL performance tweaks

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Matt Mello <alien(at)spaceship(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: ISNULL performance tweaks
Date: 2003-03-06 19:04:33
Message-ID: 200303061104.33335.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2003-03-06 19:12:07 Re: ISNULL performance tweaks
Previous Message Matt Mello 2003-03-06 18:51:11 ISNULL performance tweaks