index support is NULL - Mailing list pgsql-patches

From Teodor Sigaev
Subject index support is NULL
Date
Msg-id 460D353D.2080500@sigaev.ru
Whole thread Raw
Responses Re: index support is NULL  (Bruce Momjian <bruce@momjian.us>)
Re: index support is NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
http://www.sigaev.ru/misc/indexnulls-0.8.gz

Initially patch was developed by Martijn van Oosterhout. But it's reworked  and
support of searching NULLS to GiST too. Patch adds new column named amsearchnull
to pg_am. To recognize IS NULL clause ScanKey->sk_flags contains (SK_ISNULL &
SK_INDEXFINDNULL) and ScanKey->sk_strategy sets to InvalidStrategy. IS NOT NULL
isn't supported.

The patch was already suggested to community
(http://archives.postgresql.org/pgsql-patches/2006-12/msg00019.php
and http://archives.postgresql.org/pgsql-hackers/2007-02/msg01162.php), but the
single objection was:
http://archives.postgresql.org/pgsql-patches/2006-12/msg00028.php

Objection was about representing IS [NOT] NULL clause in SkanKey structure,
because it required to set strategy to BTEqualStrategyNumber, and Tom doubted
about needing of such support.

Now ScanKey->sk_strategy = InvalidStrategy and btree code transforms it to
BTEqualStrategyNumber in _bt_preprocess_keys(), btcostestimate knows that fact too.

GiST doesn't need to transform strategy - it looks at SK_INDEXFINDNULL only.

--
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: DEALLOCATE ALL
Next
From: Tom Lane
Date:
Subject: Re: RESET SESSION