Re: Forcing query to use an index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)MIT(dot)EDU>
Cc: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>, josh(at)agliodbs(dot)com, Michael Nachbaur <mike(at)nachbaur(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Forcing query to use an index
Date: 2003-03-04 22:33:20
Message-ID: 8864.1046817200@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Greg Stark <gsstark(at)MIT(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message patrick 2003-03-05 01:39:42 upgrading from 7.1.2 to 7.3.2
Previous Message Miriam Fernández Galicia 2003-03-04 22:24:21 unsuscribe