Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 346689FB3A3 for ; Sun, 27 May 2007 15:42:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 81552-10 for ; Sun, 27 May 2007 15:41:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from h07.llord.com (unknown [195.140.142.194]) by postgresql.org (Postfix) with ESMTP id 921889FB39C for ; Sun, 27 May 2007 15:41:53 -0300 (ADT) Received: from par69-8-88-161-102-87.fbx.proxad.net ([88.161.102.87] helo=apollo13) by h07.llord.com with esmtpa (Exim 4.66) (envelope-from ) id 1HsNgO-0005Kc-Ut; Sun, 27 May 2007 20:41:37 +0200 Date: Sun, 27 May 2007 20:44:20 +0200 To: "Alexander Staubo" Subject: Re: Feature suggestion : FAST CLUSTER From: PFC Cc: "Jim C. Nasby" , "pgsql-performance@postgresql.org" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20070527155338.GM92628@nasby.net> <88daf38c0705271127x3fb1e83cp7d42e417cf046840@mail.gmail.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <88daf38c0705271127x3fb1e83cp7d42e417cf046840@mail.gmail.com> User-Agent: Opera Mail/9.10 (Linux) X-PopBeforeSMTPSenders: junk@peufeu.com, lists@peufeu.com, peufeu@peufeu.com, pfcaillaud@peufeu.com X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - h07.llord.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - peufeu.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.158 tagged_above=0 required=5 tests=AWL=-0.432, BAYES_40=-0.185, RCVD_IN_NJABL_SPAM=2.775 X-Spam-Level: ** X-Archive-Number: 200705/567 X-Sequence-Number: 24957 > How does it know what to cluster by? Does it gather statistics about > query patterns on which it can decide an optimal clustering, or does > it merely follow a clustering previously set up by the user? Nothing fancy, InnoDB ALWAYS clusters on the primary key, whatever it is. So, if you can hack your stuff into having a primary key that clusters nicely, good for you. If not, well... So, I used (topic_id, post_id) as the PK, even though it isn't the real PK (this should be post_id)...