Re: inconsistent/weird index usage

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hannu Krosing <hannu@tm.ee>
Cc: Josh Berkus <josh@agliodbs.com>, Dustin Sallings <dustin@spy.net>, pgsql-performance@postgresql.org
Date: 2004-10-02T23:44:21Z
Lists: 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