From: Greg Stark <gsstark@mit.edu>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: Scott Marlowe <smarlowe@g2switchworks.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: 8.x index insert performance
Date: 02 Nov 2005 12:26:25 -0500
Message-ID: <87oe53hsfy.fsf@stark.xeocode.com> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3417DD732@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB3417DD732@Herge.rcsinc.local>
"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> > select * from sometable where somefield IS NULL won't work because IS
> is
> > not a nomally indexible operator.
>
> Ah, I didn't know that. So there is no real reason not to exclude null
> values from all your indexes :). Reading Tom's recent comments
> everything is clear now.
There are other reasons. If you want a query like
SELECT * FROM tab ORDER BY col LIMIT 10
to use an index on col then it can't exclude NULLs or else it wouldn't be
useful. (Oracle actually has this problem, you frequently have to add WHERE
col IS NOT NULL" in order to let it use an index.)
--
greg
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: gsstark@mit.edu, merlin.moncure@rcsonline.com, smarlowe@g2switchworks.com
Subject: Re: 8.x index insert performance
In-Reply-To: <87oe53hsfy.fsf@stark.xeocode.com>
* 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