Re: Partial Indices vs. mixing columns and functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Mike Mascari <mascarm(at)mascari(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Partial Indices vs. mixing columns and functions
Date: 2001-07-17 15:10:13
Message-ID: 24966.995382613@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> I've been think about adding IS (NOT) NULL type clauses and it doesn't look
> too hard but I wonder if my logic is right.

I think all you need is to add the correct implication rules to
indxpath.c. Let's see:

IS NULL => IS NULL

IS NOT NULL => IS NOT NULL

IS TRUE => IS TRUE

IS TRUE => IS NOT FALSE (but not vice versa)

IS TRUE => IS NOT UNKNOWN (but not vice versa)

IS NOT TRUE => IS NOT TRUE

and similarly to the last four for IS FALSE and IS UNKNOWN. No?

BTW, it might be a good idea to split out the implication code into a
new file, probably in optimizer/prep or optimizer/utils, rather than
letting it continue to grow where it is. Doesn't seem like it belongs
in indxpath.c.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jose Manuel Lorenzo Lopez 2001-07-17 15:10:24 Re: How to find out the weekday from a date???
Previous Message Ben-Nes Michael 2001-07-17 15:06:18 Re: VACUUM ANALYZE