From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
---|---|
To: | Bjørn T Johansen <btj(at)havleik(dot)no> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Indexes? |
Date: | 2004-12-02 19:43:43 |
Message-ID: | 20041202194343.GA32549@wolff.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Dec 02, 2004 at 07:11:29 +0100,
Bjørn T Johansen <btj(at)havleik(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Marc G. Fournier | 2004-12-02 19:44:15 | Re: List archives not being updated? |
Previous Message | Karsten Hilbert | 2004-12-02 18:27:19 | problem with multiple invocations of a deferred constraint trigger |