X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 289739DC80C for ; Tue, 27 Dec 2005 13:13:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54026-08 for ; Tue, 27 Dec 2005 13:13:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id EBF839DC81A for ; Tue, 27 Dec 2005 13:13:50 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id jBRHDh9q005442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Dec 2005 10:13:46 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id jBRHDhD2070137; Tue, 27 Dec 2005 10:13:43 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id jBRHDhvu070136; Tue, 27 Dec 2005 10:13:43 -0700 (MST) (envelope-from mfuhr) Date: Tue, 27 Dec 2005 10:13:43 -0700 From: Michael Fuhr To: Albert Cervera Areny Cc: pgsql-performance@postgresql.org Subject: Re: Performance problems with 8.1.1 compared to 7.4.7 Message-ID: <20051227171343.GA70061@winnie.fuhr.org> References: <200512271709.29185.albert@sedifa.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200512271709.29185.albert@sedifa.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.044 required=5 tests=[AWL=0.044] X-Spam-Score: 0.044 X-Spam-Level: X-Archive-Number: 200512/633 X-Sequence-Number: 16454 On Tue, Dec 27, 2005 at 05:09:28PM +0100, Albert Cervera Areny wrote: > However, now we have a query that is much slower with 8.1 compared to 7.4. > The query lasts 7minutes (all the times we try) with 8.1, keeping CPU usage > at 93~97% while it lasts 25 seconds in 7.4 the first time going down to 4 > seconds the following tries. > We're not experts at all but we can't see anything strange with the > differences of EXPLAIN in the queries. Below I paste the query and the > EXPLAIN output. Could you post the EXPLAIN ANALYZE output of the query on both systems? That'll show how accurate the planner's estimates are. Have you run ANALYZE (or VACUUM ANALYZE) on the tables in both versions? The row count estimates in the 8.1.1 query differ from those in the 7.4.7 query. Are the two versions using the same data set? Are your configuration settings the same in both versions? You mentioned increasing work_mem, but what about others like effective_cache_size, random_page_cost, and shared_buffers? -- Michael Fuhr