Re: Indexes? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Indexes?
Date
Msg-id 20041202194343.GA32549@wolff.to
Whole thread Raw
In response to Indexes?  (Bjørn T Johansen <btj@havleik.no>)
List pgsql-general
On Thu, Dec 02, 2004 at 07:11:29 +0100,
  Bjørn T Johansen <btj@havleik.no> wrote:
> I have a table where I need to use "..where curdate between fromDate and
> toDate".
> Is it best to have two indexes, one for FromDate and one for toDate or just
> one index for both the fields?

Assuming that curdate is something like the date when the query is being
run and that FromDate and toDate are columns in the table you are
searching, then you probably want indexes on each column. A combined
index scan wouldn't be useful. An index scan on either FromDate or toDate
might be useful depending on the distribution of values in those columns
and the value of curdate.

pgsql-general by date:

Previous
From: "Vincent Hikida"
Date:
Subject: Re: Indexes?
Next
From: "Marc G. Fournier"
Date:
Subject: Re: List archives not being updated?