Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T1Kvb-0003Ta-AS for pgsql-performance@postgresql.org; Tue, 14 Aug 2012 17:29:15 +0000 Received: from mh6.mail.rice.edu ([128.42.201.4]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T1KvX-0004C7-4K for pgsql-performance@postgresql.org; Tue, 14 Aug 2012 17:29:14 +0000 Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id 7AC7311F879; Tue, 14 Aug 2012 12:29:10 -0500 (CDT) Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id 6E61211F87E; Tue, 14 Aug 2012 12:29:10 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh6.mail.rice.edu, auth channel Received: from mh6.mail.rice.edu ([127.0.0.1]) by mh6.mail.rice.edu (mh6.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 6F249JcQqtgZ; Tue, 14 Aug 2012 12:29:10 -0500 (CDT) X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh6.mail.rice.edu (Postfix) with ESMTP id 357B611F879; Tue, 14 Aug 2012 12:29:10 -0500 (CDT) Received: by aart.rice.edu (Postfix, from userid 18612) id 2C96D100B74; Tue, 14 Aug 2012 12:29:10 -0500 (CDT) Date: Tue, 14 Aug 2012 12:29:10 -0500 From: "ktm@rice.edu" To: Jeff Janes Cc: Doug Hunley , pgsql-performance@postgresql.org Subject: Re: cluster on conditional index? Message-ID: <20120814172910.GP27500@aart.rice.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201208/83 X-Sequence-Number: 47621 On Tue, Aug 14, 2012 at 10:10:47AM -0700, Jeff Janes wrote: > On Tue, Aug 14, 2012 at 8:27 AM, Doug Hunley wrote: > > According to the docs on cluster: > > if you tend to access some data more than others, and there is an > > index that groups them together, you will benefit from using CLUSTER > > > > however, this doesn't address the situation where you have a > > conditional index. > > It seems like it is not allowed. > > jjanes=# create index on pgbench_accounts (aid) where bid=33; > jjanes=# cluster pgbench_accounts USING pgbench_accounts_aid_idx ; > ERROR: cannot cluster on partial index "pgbench_accounts_aid_idx" > > But I don't see a fundamental reason it can't be allowed, maybe > implementing that should be on the to-do list. > > Cheers, > > Jeff > It probably has to do with the fact that a conditional index, does not include every possible row in the table. Although, a "cluster" of the matching rows and then leave the rest in place, should work. How is that for hand-waving. :) Regards, Ken