X-Original-To: pgsql-patches-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D6A359FB2C2; Wed, 9 Aug 2006 17:17:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 53605-10; Wed, 9 Aug 2006 20:17:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 4ED709FB25E; Wed, 9 Aug 2006 17:17:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k79KH2AF028915; Wed, 9 Aug 2006 16:17:02 -0400 (EDT) To: pgsql-hackers@postgresql.org, Heikki Linnakangas cc: pgsql-patches@postgresql.org Subject: Re: Maintaining cluster order on insert In-reply-to: <44DA31B1.3090700@enterprisedb.com> References: <44DA31B1.3090700@enterprisedb.com> Comments: In-reply-to Heikki Linnakangas message dated "Wed, 09 Aug 2006 20:04:17 +0100" Date: Wed, 09 Aug 2006 16:17:02 -0400 Message-ID: <28914.1155154622@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/128 X-Sequence-Number: 20644 Heikki Linnakangas writes: > While thinking about index-organized-tables and similar ideas, it > occurred to me that there's some low-hanging-fruit: maintaining cluster > order on inserts by trying to place new heap tuples close to other > similar tuples. Doesn't this happen for free if there's enough space? UPDATE tries to place the new tuple on the same page it's already on. In practice people are only likely to cluster by primary keys (or other things that seldom change) so I don't particularly agree with inventing a large wart to support "optimally" placing things somewhere else... regards, tom lane