Re: null values / partial indices - Mailing list pgsql-hackers

From Tom Lane
Subject Re: null values / partial indices
Date
Msg-id 21444.1037198626@sss.pgh.pa.us
Whole thread Raw
In response to null values / partial indices  ("Mario Weilguni" <mario.weilguni@icomedias.com>)
List pgsql-hackers
"Mario Weilguni" <mario.weilguni@icomedias.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


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: pg_dump in 7.4
Next
From: Tom Lane
Date:
Subject: Re: RC1?