X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id AE0609FCFE2 for ; Mon, 28 Aug 2006 12:32:37 -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 91579-03 for ; Mon, 28 Aug 2006 15:32:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id F1A8B9FCFD5 for ; Mon, 28 Aug 2006 12:32:29 -0300 (ADT) Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl [201.221.200.187]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7SFWE7D007454; Mon, 28 Aug 2006 08:32:19 -0700 Received: by alvh.no-ip.org (Postfix, from userid 1000) id A307DC2DC58; Mon, 28 Aug 2006 11:31:52 -0400 (CLT) Date: Mon, 28 Aug 2006 11:31:52 -0400 From: Alvaro Herrera To: Brad Nicholson Cc: Michal Taborsky - Internet Mall , pgsql-performance@postgresql.org Subject: Re: Identifying bloated tables Message-ID: <20060828153152.GH27526@alvh.no-ip.org> Mail-Followup-To: Brad Nicholson , Michal Taborsky - Internet Mall , pgsql-performance@postgresql.org References: <44F30022.1000009@mall.cz> <1156776499.10296.5.camel@dba5.int.libertyrms.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1156776499.10296.5.camel@dba5.int.libertyrms.com> User-Agent: Mutt/1.5.12-2006-07-14 X-Virus-Scanned: ClamAV version 0.88.3, clamav-milter version 0.88.3 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Mon, 28 Aug 2006 08:32:19 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/442 X-Sequence-Number: 20627 Brad Nicholson wrote: > On Mon, 2006-08-28 at 16:39 +0200, Michal Taborsky - Internet Mall > wrote: > > I just put together a view, which helps us in indentifying which > > database tables are suffering from space bloat, ie. they take up much > > more space than they actually should. I though this might be useful for > > some folk here, because the questions about bloat-related performance > > degradation are quite common. > > Are you sure you haven't reinvented the wheel? Have you checked out > contrib/pgstattuple ? Actually, pgstattuple needs to scan the whole table, so I think having a cheap workaround that gives approximate figures is a good idea anyway. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.