Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5620965018B for ; Fri, 21 Nov 2008 12:32:57 -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 11627-06 for ; Fri, 21 Nov 2008 12:32:54 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.147]) by mail.postgresql.org (Postfix) with ESMTP id 7BAC8650185 for ; Fri, 21 Nov 2008 12:32:54 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay03.plus.net with esmtp (Exim) id 1L3Yw6-0004v5-Gn; Fri, 21 Nov 2008 16:32:50 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 3FC97274052; Fri, 21 Nov 2008 16:32:50 +0000 (GMT) Message-ID: <4926E2B2.9050202@archonet.com> Date: Fri, 21 Nov 2008 16:32:50 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: Andrus CC: PFC , pgsql-performance@postgresql.org Subject: Re: Hash join on int takes 8..114 seconds References: <49253FE1.3070706@archonet.com> <0205611B528C4C2CBA99AFC64E57D6E8@andrusnotebook> <75A918DFCF25470FAF96B3FE3D25A38B@andrusnotebook> In-Reply-To: <75A918DFCF25470FAF96B3FE3D25A38B@andrusnotebook> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 07a354cc9870c94f1bd01c0c3d96d0cf X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200811/182 X-Sequence-Number: 31913 Andrus wrote: >> - what's the size of the dataset relative to the RAM ? > > Db size is 7417 MB > relevant table sizes in desc by size order: > > 1 40595 dok 2345 MB > 2 1214 pg_shdepend 2259 MB > 6 1232 pg_shdepend_depender_index 795 MB > 7 1233 pg_shdepend_reference_index 438 MB These three are highly suspicious. They track dependencies between system object (so you can't drop function F because trigger T depends on it). http://www.postgresql.org/docs/8.3/static/catalog-pg-shdepend.html You've got 3.5GB of data there, which is a *lot* of dependencies. Try "SELECT count(*) FROM pg_shdepend". 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". If it is a million rows, you'll need to find out why. Do you have a lot of temporary tables that aren't being dropped or something similar? -- Richard Huxton Archonet Ltd