Search Postgresql Archives

Re: query for a time interval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Fuhr <mike@xxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux