Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-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
You probably want an index on name and date combined.

In response to


pgsql-performance by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group