| От | Bruno Wolff III |
|---|---|
| Тема | Re: Efficient date range search? |
| Дата | |
| Msg-id | 20021007175248.GA29443@wolff.to обсуждение |
| Ответ на | Re: Efficient date range search? (Jean-Luc Lachance <jllachan@nsd.ca>) |
| Список | pgsql-general |
On Mon, Oct 07, 2002 at 13:32:09 -0400, Jean-Luc Lachance <jllachan@nsd.ca> wrote: > Alvaro Herrera wrote: > > > > On Mon, Oct 07, 2002 at 12:11:35PM -0400, Jean-Luc Lachance wrote: > > > Shridhar Daithankar wrote: > > > > Create an index on died field. And query like > > > > > > > > select * from pets where died < "last year july 4 7:01 PM; > > > > > If the pet is still alive today died would be NULL and the where clause > > > would not be true. > > > > In that case check for NULL explicitly, > > > > select * from pets where died > [date] or died is null; > > > Then you're back to whole table scan... :( You could use 'infinity'::timestamp as a code for pets that are currently alive instead of null.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера