Re: "where x between y and z" for timestamp data types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: M Q <thekaib(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: "where x between y and z" for timestamp data types
Date: 2012-08-12 21:28:24
Message-ID: 14441.1344806904@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jeff Davis 2012-08-12 22:29:46 Re: Joining time fields?
Previous Message Jeff Davis 2012-08-12 21:07:23 Re: "where x between y and z" for timestamp data types