Re: Forcing query to use an index - Mailing list pgsql-sql

From Tom Lane
Subject Re: Forcing query to use an index
Date
Msg-id 8864.1046817200@sss.pgh.pa.us
Whole thread Raw
In response to Re: Forcing query to use an index  (Greg Stark <gsstark@mit.edu>)
List pgsql-sql
Greg Stark <gsstark@MIT.EDU> writes:
> I admit using 9999-01-01 as a date gives me the willies. But it does match
> with the way the field is used and it produces nice clean index range
> lookups.

If you're willing to switch to type 'timestamp' then you could use the
special value 'infinity' (or '-infinity' when you need it to sort before
instead of after normal times).

There was some talk awhile back of making type 'date' support infinity
as well.  This'd cost one day at each end of the allowable range, which
doesn't seem like a big loss.  But no one's done the legwork.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tomasz Myrta
Date:
Subject: Re: LIMIT and SUBQUERIES
Next
From: Christoph Haller
Date:
Subject: Re: Insert multiple Rows