Re: null values / partial indices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mario Weilguni" <mario(dot)weilguni(at)icomedias(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: null values / partial indices
Date: 2002-11-13 14:43:46
Message-ID: 21444.1037198626@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Mario Weilguni" <mario(dot)weilguni(at)icomedias(dot)com> writes:
> I noticed that the planner is unable to select an index scan when a partial
> index is available, the partial index is based on a "NOT NULL" condition.

It wants you to do this:

select id from str where url='foobar' and url is not null;

I know and you know that "url='foobar'" implies url is not null,
but the code that checks for applicability of partial indexes is not
that bright.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2002-11-13 14:52:34 Re: pg_dump in 7.4
Previous Message Rod Taylor 2002-11-13 14:29:21 Re: pg_dump in 7.4