Re: The planner hates me. - Mailing list pgsql-general

From Scott Marlowe
Subject Re: The planner hates me.
Date
Msg-id dcc563d10809250906n3e90e3b1r602db291de8594e@mail.gmail.com
Whole thread Raw
In response to Re: The planner hates me.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: The planner hates me.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, Sep 25, 2008 at 9:38 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> The problem you've got here is that the planner has got absolutely no
> visibility into the behavior of get_dates().  In particular it doesn't
> realize that the values being generated are close to the end of the
> range of dates that are in the table, and thus the date1 >= dates.date
> condition is far more selective than the date2 < dates.date condition.
> If you look closely at the rowcount estimates you'll see that those are
> actually being estimated the same, to within roundoff error.  So looking
> at two indexes instead of one doesn't look like a win to it.

Couldn't they make a simple immutable function and index on that?

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: The planner hates me.
Next
From: Justin Yao
Date:
Subject: Re: how can I find out the numeric directory name of each database in PostgreSQL 8.3