X-Original-To: pgsql-patches-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2D82B9FB2F3; Thu, 10 Aug 2006 05:24:39 -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 58363-02; Thu, 10 Aug 2006 05:24:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from webmail.enterprisedb.com (edb04.managed.contegix.com [63.246.7.176]) by postgresql.org (Postfix) with ESMTP id 8D55E9FB2BE; Thu, 10 Aug 2006 05:24:26 -0300 (ADT) Received: from [10.252.194.41] (0-sar-4.ldc.thecloud.net [194.42.124.16]) by webmail.enterprisedb.com (Postfix) with ESMTP id AF9D3A24966; Thu, 10 Aug 2006 03:24:22 -0500 (CDT) Message-ID: <44DAEA1C.5050509@enterprisedb.com> Date: Thu, 10 Aug 2006 09:11:08 +0100 From: Heikki Linnakangas User-Agent: Thunderbird 1.5.0.4 (X11/20060713) MIME-Version: 1.0 To: "Jonah H. Harris" Cc: Tom Lane , pgsql-hackers@postgresql.org, pgsql-patches@postgresql.org Subject: Re: Maintaining cluster order on insert References: <44DA31B1.3090700@enterprisedb.com> <28914.1155154622@sss.pgh.pa.us> <36e682920608091347m4e075a8cv6a04e3c4d97ed6f4@mail.gmail.com> In-Reply-To: <36e682920608091347m4e075a8cv6a04e3c4d97ed6f4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.617 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/142 X-Sequence-Number: 20658 Jonah H. Harris wrote: > On 8/9/06, Tom Lane wrote: >> UPDATE tries to place the new tuple on the same page it's already >> on. > > I think he meant for INSERT. > Right. Update is indeed taken care of already. One example where this would help would be a customer_history table that stores all transactions of a customer. Primary key is (customer_id, transaction_id). You would want to keep the table clustered by customer_id to make it quick to retrieve all transactions of a customer. In general, any table with more or less random insert/delete activity that you want to keep in order would benefit. - Heikki