Re: timestamp interval issue

Поиск
Список
Период
Сортировка
Искать
От
Nis Jørgensen
Тема
Re: timestamp interval issue
Дата
Msg-id
fed3fo$r3m$1@sea.gmane.org
Ответ на
Список
Дерево обсуждения
timestamp interval issue "Lonni J Friedman" <netllama@gmail.com>
Re: timestamp interval issue Valentin Gjorgjioski <tinodj@mt.net.mk>
Re: timestamp interval issue "Lonni J Friedman" <netllama@gmail.com>
Re: timestamp interval issue Michael Glaesemann <grzm@seespotcode.net>
Re: timestamp interval issue Valentin Gjorgjioski <tinodj@mt.net.mk>
Re: timestamp interval issue Valentin Gjorgjioski <tinodj@mt.net.mk>
Re: timestamp interval issue "Lonni J Friedman" <netllama@gmail.com>
Re: timestamp interval issue Michael Glaesemann <grzm@seespotcode.net>
Re: timestamp interval issue "Lonni J Friedman" <netllama@gmail.com>
Re: timestamp interval issue Michael Glaesemann <grzm@seespotcode.net>
Re: timestamp interval issue "Lonni J Friedman" <netllama@gmail.com>
Re: timestamp interval issue Michael Glaesemann <grzm@seespotcode.net>
Re: timestamp interval issue Nis Jørgensen <nis@superlativ.dk>
Re: timestamp interval issue Nis Jørgensen <nis@superlativ.dk>
Re: timestamp interval issue Michael Glaesemann <grzm@seespotcode.net>
Nis Jørgensen skrev:
> Lonni J Friedman skrev:
>> Greetings,
>> I've got an interesting problem.  I have a table with a column full of
>> timestamps.  I need a means of returning only the rows which have a
>> timestamp that falls after the last 16:00 and before the next 16:00
>> (on the clock), regardless of date.

> SELECT *
> FROM footable0
> WHERE (date_created - interval '16 hours')::date = (now() - interval '16
> hours')::date;
> 
> Tested.

Unfortunately, the performance is horrible - it is using a seqscan. Use
Michaels suggestion instead (at least if you have a significant amount
of data).

Nis
В списке pgsql-novice по дате отправления
От: Nis Jørgensen
Дата:
Сообщение: Re: timestamp interval issue
От: Michael Glaesemann
Дата:
Сообщение: Re: timestamp interval issue
FAQ