Re: Ignoring index on (A is null), (A is not null) conditions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Cestmir Hybl" <cestmirl(at)freeside(dot)sk>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Ignoring index on (A is null), (A is not null) conditions
Date: 2003-10-30 15:31:26
Message-ID: 28214.1067527886@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Cestmir Hybl" <cestmirl(at)freeside(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-10-30 16:11:12 Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine. [ with better indenting ]
Previous Message Christopher Browne 2003-10-30 15:10:47 Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine. [ with better indenting ]