Re: inconsistent/weird index usage - Mailing list pgsql-performance

From Tom Lane
Subject Re: inconsistent/weird index usage
Date
Msg-id 27189.1096760661@sss.pgh.pa.us
Whole thread Raw
In response to Re: inconsistent/weird index usage  (Hannu Krosing <hannu@tm.ee>)
List pgsql-performance
Hannu Krosing <hannu@tm.ee> writes:
>> No.  It's not fixed as of CVS tip either, although there was some talk
>> of doing something in time for 8.0.

> That's weird - my 7.4.2 databases did not consider (now()-'15
> min'::interval) to be a constant whereas 7.4.5 does (i.e. it does use
> index scan on index on datetime column)

The question isn't whether it can use it as an indexscan bound; the
question is whether it can derive an accurate rowcount estimate.
The issue is exactly that STABLE functions work for one but not the
other.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query planner problem
Next
From: Pierre-Frédéric Caillaud
Date:
Subject: Re: Caching of Queries