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

Поиск
Список
Период
Сортировка
От M Q
Тема Re: "where x between y and z" for timestamp data types
Дата
Msg-id CAGnP9ZjPE9qNF1XTt8X-3tHJ2Cin6gpPpkXVVvTbXr6rBNQg1w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "where x between y and z" for timestamp data types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
The 'date' field is a timestamp without timezone.   The upper and lower bounds of the BETWEEN are identical just for testing purposes.  Any range would do.

I'm having trouble reproducing the problem on a similar data set.  I created a new db, same table schema, same row count with randomly generated data for testing but the function works fine.  So perhaps my problem is related to the tables rather than the function.  If I can successfully reproduce the problem with another data set I'll send example code to share.  I'll also look into the links you gave me.

Thanks,
Kaib




On Sun, Aug 12, 2012 at 2:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jeff Davis <pgsql@j-davis.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

В списке pgsql-novice по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Joining time fields?
Следующее
От: Philippe Dirkse
Дата:
Сообщение: Need help importing dump with bytea into db