X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B69505E3639 for ; Thu, 26 Aug 2004 18:02:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17719-03 for ; Thu, 26 Aug 2004 21:01:54 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id E692A5E46D4 for ; Thu, 26 Aug 2004 18:01:51 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i7QL1oLq020417 for ; Thu, 26 Aug 2004 21:01:50 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i7QL0k0M020102 for pgsql-performance@postgresql.org; Thu, 26 Aug 2004 21:00:46 GMT From: Mischa Sandberg Reply-To: ischamay.andbergsay@activestateway.com User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Equivalent praxis to CLUSTERED INDEX? References: <200408261818.i7QIIrr09640@candle.pha.pa.us> <200408261132.30732.josh@agliodbs.com> In-Reply-To: <200408261132.30732.josh@agliodbs.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 40 Message-ID: <3csXc.56326$X12.25148@edtnps84> Date: Thu, 26 Aug 2004 21:00:47 GMT To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=NO_DNS_FOR_FROM X-Spam-Level: * X-Archive-Number: 200408/417 X-Sequence-Number: 8053 Ummm ... not quite. In MSSQL/Sybase/Oracle, a clustered index maintains its space saturation as part of each update operation. High activity does indeed result in less-full pages (typically 60-80% full for tables with heavy deletions or rowsize changes). To bring the percentage back up, you run DBCC INDEXDEFRAG, which also does what you'd expect of a normal file defragmenter -- put related disk pages together on the platter. But the performance difference is hardly as severe as I gather it can be if you neglect to vacuum. As for SQL Server being a 'single-user database' ... ummm ... no, I don't think so. I'm REALLY happy to be shut of the Microsoft world, but MSSQL 7/2000/2005 is a serious big DB engine. It also has some serious bright heads behind it. They hired Goetz Graefe and Paul (aka Per-Ake) Larsen away from academia, and it shows, in the join and aggregate processing. I'll be a happy camper if I manage to contribute something to PG that honks the way their stuff does. Happy to discuss, too. Josh Berkus wrote: > Bruce, > > >>How do vendors actually implement auto-clustering? I assume they move >>rows around during quiet periods or have lots of empty space in each >>value bucket. > > > That's how SQL Server does it. In old versions (6.5) you had to manually > send commands to update the cluster, same as PG. Also, when you create a > cluster (or an index or table for that matter) you can manually set an amount > of "space" to be held open on each data page for updates. > > Also keep in mind that SQL Server, as a "single-user database" has a much > easier time with this. They don't have to hold several versions of an index > in memory and collapse it into a single version at commit time. > > All that being said, we could do a better job of "auto-balancing" clustered > tables. I believe that someone was working on this in Hackers through what > they called "B-Tree Tables". What happened to that? >