Re: Question about clustering multiple columns

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Benjamin Arai <benjamin(at)araisoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-performance(at)postgresql(dot)org
Subject: Re: Question about clustering multiple columns
Date: 2006-06-16 15:31:32
Message-ID: 20060616153132.GA9056@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

On Tue, Jun 13, 2006 at 09:04:15 -0700,
Benjamin Arai <benjamin(at)araisoft(dot)com> wrote:
> Hi,
>
> I have a database where there are three columns (name,date,data). The
> queries are almost always something like SELECT date,data FROM table WHERE
> name=blah AND date > 1/1/2005 AND date < 1/1/2006;. I currently have three
> B-tree indexes, one for each of the columns. Is clustering on date index
> going to be what I want, or do I need a index that contains both name and
> date?

I would expect that clustering on the name would be better for the above
query.
You probably want an index on name and date combined.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message LLC 2006-06-16 16:42:51 PL/Perl questions...
Previous Message Bruce Momjian 2006-06-16 15:18:56 Re: Omitting tablespace creation from pg_dumpall...

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2006-06-16 16:03:22 Re: Test request for Stats collector performance improvement
Previous Message Robert Lor 2006-06-16 15:18:58 Sun Donated a Sun Fire T2000 to the PostgreSQL community