Re: Ignoring index on (A is null), (A is not null) conditions - Mailing list pgsql-performance

From Tom Lane
Subject Re: Ignoring index on (A is null), (A is not null) conditions
Date
Msg-id 28214.1067527886@sss.pgh.pa.us
Whole thread Raw
In response to Re: Ignoring index on (A is null), (A is not null) conditions  ("Cestmir Hybl" <cestmirl@freeside.sk>)
List pgsql-performance
"Cestmir Hybl" <cestmirl@freeside.sk> writes:
>> In fact, I need to filter by expression ((A is null) or (A > const)).

I wonder whether you shouldn't reconsider your data representation.
Perhaps the condition you are using "null" for would be better
represented by setting A to infinity.  (The float and timestamp
datatypes actually have a concept of infinity; for other types you
can fake it with a large positive value.)

            regards, tom lane

pgsql-performance by date:

Previous
From: Christopher Browne
Date:
Subject: Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine. [ with better indenting ]
Next
From: Rob Nagler
Date:
Subject: Re: vacuum locking