Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9A65F9FB1CB for ; Mon, 25 Sep 2006 19:27:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 64245-07 for ; Mon, 25 Sep 2006 19:27:06 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.225]) by postgresql.org (Postfix) with ESMTP id 89D9F9FA502 for ; Mon, 25 Sep 2006 19:27:05 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id t13so2062917wxc for ; Mon, 25 Sep 2006 15:27:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=mKzwH9/ZMdxgf8Y4FZ+mxMpSXzKXtVwKWUFyQC2ReI8icyxocOQ9LWI4XdZPn23rnvRbXtSvIanaksNqxoQ3g964gVn+OAnaEn11vRDfw/XkHazbAaWvuTZto5gUPnAGBOEdywchTDUtf9oyME+COnJej3TJg9bP62QVYWhF7js= Received: by 10.90.71.12 with SMTP id t12mr609009aga; Mon, 25 Sep 2006 15:27:04 -0700 (PDT) Received: by 10.90.93.9 with HTTP; Mon, 25 Sep 2006 15:27:03 -0700 (PDT) Message-ID: <1c66bda80609251527i4e8bad89jb6c1420cd44a8a33@mail.gmail.com> Date: Tue, 26 Sep 2006 10:27:03 +1200 From: adey To: "Chris Hoover" Subject: Re: best way to choose index to cluster on? Cc: "pgsql-admin@postgresql.org" In-Reply-To: <1d219a6f0609251357y33e74c56u4d283af07cd45360@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36133_10953213.1159223223073" References: <1d219a6f0609251357y33e74c56u4d283af07cd45360@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.57 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/275 X-Sequence-Number: 23189 ------=_Part_36133_10953213.1159223223073 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline A good guide for a clustered index is:- Will the index be unique, static and narrow. If not, avoid clustered indexing as they require extra work on disk to maintain their sequence. On 9/26/06, Chris Hoover wrote: > > I am looking to squeeze a bit more speed out of my database by clustering > most of my tables. However, on tables with multiple indexes, how is the > best way to choose the index. I am thinking I want to use the index with > the largest pg_stat_user_indexes.idx_tup_read. Would this be correct? If > not, what column(s) and views should I be looking at to find the most > popular index? > > Secondly, I have some partial indexes on a very active table, and it tends > to have the highest idx_tup_read for that table. Is is possible to cluster > on a partial index? > > Thanks, > > Chris > ------=_Part_36133_10953213.1159223223073 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
A good guide for a clustered index is:-
Will the index be unique, static and narrow.
If not, avoid clustered indexing as they require extra work on disk to maintain their sequence.

 
On 9/26/06, Chris Hoover <revoohc@gmail.com> wrote:
I am looking to squeeze a bit more speed out of my database by clustering most of my tables.  However, on tables with multiple indexes, how is the best way to choose the index.  I am thinking I want to use the index with the largest pg_stat_user_indexes.idx_tup_read.  Would this be correct?  If not, what column(s) and views should I be looking at to find the most popular index?

Secondly, I have some partial indexes on a very active table, and it tends to have the highest idx_tup_read for that table.  Is is possible to cluster on a partial index?

Thanks,

Chris

------=_Part_36133_10953213.1159223223073--