Re: Index on a NULL-value - Mailing list pgsql-performance

From Tobias Brox
Subject Re: Index on a NULL-value
Date
Msg-id 20050531055932.GL26100@tobias.exoweb.net
Whole thread Raw
In response to Re: Index on a NULL-value  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
> 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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index on a NULL-value
Next
From: "Praveen Raja"
Date:
Subject: very large table