Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2CB6265032A for ; Fri, 21 Nov 2008 17:53:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93238-06 for ; Fri, 21 Nov 2008 17:53:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out.neti.ee (smtp-out.neti.ee [194.126.126.44]) by mail.postgresql.org (Postfix) with ESMTP id 65DCA650324 for ; Fri, 21 Nov 2008 17:53:06 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by MXR-5.estpak.ee (Postfix) with ESMTP id 3EA6F1DF7AB; Fri, 21 Nov 2008 23:53:03 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at estpak.ee Received: from smtp-out.neti.ee ([127.0.0.1]) by localhost (MXR-5.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JMP16b6MUppT; Fri, 21 Nov 2008 23:52:59 +0200 (EET) Received: from Relayhost1.neti.ee (Relayhost1 [88.196.174.141]) by MXR-5.estpak.ee (Postfix) with ESMTP id DEB011DF52B; Fri, 21 Nov 2008 23:52:59 +0200 (EET) X-SMTP-Auth-NETI-Businesmail: no Received: from andrusnotebook (unknown [195.50.198.194]) by Relayhost1.neti.ee (Postfix) with SMTP id 3C0242A50C4; Fri, 21 Nov 2008 23:52:59 +0200 (EET) Message-ID: From: "Andrus" To: "Richard Huxton" Cc: "PFC" , References: <49253FE1.3070706@archonet.com> <0205611B528C4C2CBA99AFC64E57D6E8@andrusnotebook> <75A918DFCF25470FAF96B3FE3D25A38B@andrusnotebook> <4926E2B2.9050202@archonet.com> In-Reply-To: <4926E2B2.9050202@archonet.com> Subject: Re: Hash join on int takes 8..114 seconds Date: Fri, 21 Nov 2008 23:51:24 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=STOX_REPLY_TYPE=0.001 X-Spam-Level: X-Archive-Number: 200811/198 X-Sequence-Number: 31929 > If it's not a million rows, then the table is bloated. Try (as postgres > or some other db superuser) "vacuum full pg_shdepend" and a "reindex > pg_shdepend". reindex table pg_shdepend causes error ERROR: shared table "pg_shdepend" can only be reindexed in stand-alone mode vacuum full verbose pg_shdepend seems to work but indexes are still bloated. How to remove index bloat ? sizes after vacuum full are below. pg_shdepend size 1234 MB includes its index sizes, so indexes are 100% bloated. 4 1214 pg_catalog.pg_shdepend 1234 MB 6 1232 pg_catalog.pg_shdepend_depender_index 795 MB 7 1233 pg_catalog.pg_shdepend_reference_index 439 MB Andrus. vacuum full verbose pg_shdepend; INFO: vacuuming "pg_catalog.pg_shdepend" INFO: "pg_shdepend": found 254 removable, 3625 nonremovable row versions in 131517 pages DETAIL: 0 dead row versions cannot be removed yet. Nonremovable row versions range from 49 to 49 bytes long. There were 16115259 unused item pointers. Total free space (including removable row versions) is 1010091872 bytes. 131456 pages are or will become empty, including 8 at the end of the table. 131509 pages containing 1010029072 free bytes are potential move destinations. CPU 2.08s/0.92u sec elapsed 63.51 sec. INFO: index "pg_shdepend_depender_index" now contains 3625 row versions in 101794 pages DETAIL: 254 index row versions were removed. 101611 index pages have been deleted, 20000 are currently reusable. CPU 0.87s/0.28u sec elapsed 25.44 sec. INFO: index "pg_shdepend_reference_index" now contains 3625 row versions in 56139 pages DETAIL: 254 index row versions were removed. 56076 index pages have been deleted, 20000 are currently reusable. CPU 0.51s/0.15u sec elapsed 23.10 sec. INFO: "pg_shdepend": moved 1518 row versions, truncated 131517 to 25 pages DETAIL: CPU 5.26s/2.39u sec elapsed 89.93 sec. INFO: index "pg_shdepend_depender_index" now contains 3625 row versions in 101794 pages DETAIL: 1518 index row versions were removed. 101609 index pages have been deleted, 20000 are currently reusable. CPU 0.94s/0.28u sec elapsed 24.61 sec. INFO: index "pg_shdepend_reference_index" now contains 3625 row versions in 56139 pages DETAIL: 1518 index row versions were removed. 56088 index pages have been deleted, 20000 are currently reusable. CPU 0.54s/0.14u sec elapsed 21.11 sec. Query returned successfully with no result in 253356 ms