From: Tobias Brox <tobias@nordicbet.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruno Wolff III <bruno@wolff.to>
Cc: Tobias Brox <tobias@nordicbet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index on a NULL-value
Date: Tue, 31 May 2005 13:59:32 +0800
Message-ID: <20050531055932.GL26100@tobias.exoweb.net> (raw)
In-Reply-To: <7923.1117513113@sss.pgh.pa.us>
References: <20050531030207.GD26100@tobias.exoweb.net>
<20050531032119.GH26100@tobias.exoweb.net>
<20050531033633.GA20015@wolff.to>
<7923.1117513113@sss.pgh.pa.us>
> CREATE INDEX b_is_null ON mock(a) WHERE b IS NULL;
>
> where a is chosen as a column that you frequently also test in
> conjunction with "b IS NULL". That is, the above index can efficiently
> handle queries like
>
> ... WHERE a = 42 AND b IS NULL ...
This is wonderful, it seems like most of our problems (probably also
regarding the "index on timestamp"-thread I started separately) can be
solved with partial indexing on expressions. No need to hide under
bedclothes anymore ;-)
--
Tobias Brox, Beijing
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: tobias@nordicbet.com, tgl@sss.pgh.pa.us, bruno@wolff.to
Subject: Re: Index on a NULL-value
In-Reply-To: <20050531055932.GL26100@tobias.exoweb.net>
* 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