From: Tomas Vondra <tv@fuzzy.cz>
Cc: pgsql-performance@postgresql.org
Subject: Re: Using index for IS NULL query
Date: Thu, 13 Nov 2008 01:27:31 +0100
Message-ID: <491B7473.3050407@fuzzy.cz> (raw)
In-Reply-To: <1d709ecc0811111500i3c63e345qfa3be90264629256@mail.gmail.com>
References: <gfcprb$m40$1@news.hub.org>
<4919F2C6.4000303@fuzzy.cz>
<1d709ecc0811111500i3c63e345qfa3be90264629256@mail.gmail.com>
Well, you're obviously right - I didn't know this. I guess I've found
that the index is not used for null values, and deduced somehow that
NULL values are not stored in the index.
Thanks, it's nice to find out a 'bug' before it's too late :-)
regards
Tomas
> Are you sure NULL values are not stored? btree, gist and bitmap index
> and search for NULL values.
>
> select amname, amindexnulls, amsearchnulls from pg_am;
>
> amname | amindexnulls | amsearchnulls
> --------+--------------+---------------
> btree | t | t
> hash | f | f
> gist | t | t
> gin | f | f
> bitmap | t | t
> (5 rows)
>
>
> Sincerely yours,
> Vladimir Sitnikov
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: tv@fuzzy.cz
Subject: Re: Using index for IS NULL query
In-Reply-To: <491B7473.3050407@fuzzy.cz>
* 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