Re: Indexes?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Vincent Hikida <vhikida(at)inreach(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Indexes?
Date: 2004-12-02 20:10:35
Message-ID: 20041202201035.GA2080@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 01, 2004 at 23:16:48 -0800,
Vincent Hikida <vhikida(at)inreach(dot)com> wrote:
> I believe that it is better to have a concatenated key of
> (toDate,FromDate). The reason the toDate should come first is that for more
> "recent" records, finding curDates less than toDate is much more selective
> than finding curDates greater than fromDate. Actually I'm not sure if
> fromDate is that helpful either as part of the concatenated key (it
> probably depends) but definitely not by itself.

I combined index won't be very useful for the kind of search he is doing.
And not having an index on FromDate could hurt in some cases depending
on the distribution of values.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2004-12-02 20:11:46 Re: [HACKERS] Adding Reply-To: <listname> to Lists
Previous Message Alvaro Herrera 2004-12-02 19:59:54 Re: [HACKERS] Adding Reply-To: <listname> to Lists configuration ...