Re: query for a time interval

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: query for a time interval
Дата
Msg-id 19830.1135351375@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: query for a time interval  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
Michael Fuhr <mike@fuhr.org> writes:
> Unless I'm missing something that wouldn't use an index either,
> because the planner wouldn't know what value to compare start_date
> against without hitting each row to find that row's time_to_live.
> But something like this should be able to use an expression index
> on (start_date + time_to_live):

> WHERE start_date + time_to_live < now()

Or perhaps simpler, get rid of time_to_live in favor of an end_date
column, which could be indexed directly.

            regards, tom lane

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Indices for select count(*)?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Indices for select count(*)?