Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> I briefly tried your example and I didn't see a problem. Can you provide
> some sample data that illustrates your problem? Also, is the "date"
> field a date or a timestamp? And why are the upper and lower bounds of
> the BETWEEN identical?
I'll bet a nickel the planner is choosing a different plan when it
doesn't know that the timestamp range condition is extremely selective.
regards, tom lane