X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9421B30DBDD for ; Mon, 16 Jun 2003 06:40:55 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 65502-01 for ; Mon, 16 Jun 2003 03:40:44 -0300 (ADT) Received: from nitrogen.id.pl (smtp.id.pl [193.178.214.4]) by svr1.postgresql.org (Postfix) with SMTP id 6A72630DBD7 for ; Mon, 16 Jun 2003 03:40:43 -0300 (ADT) Received: (qmail 25548 invoked by uid 0); 16 Jun 2003 06:38:51 -0000 Received: from siaco.id.pl (213.25.114.8) by smtp.id.pl with SMTP; 16 Jun 2003 06:38:51 -0000 Received: (qmail 31868 invoked by uid 1000); 16 Jun 2003 06:38:50 -0000 Date: Mon, 16 Jun 2003 08:38:50 +0200 From: siaco@allegro.pl To: pgsql-performance@postgresql.org Subject: Re: 7.3 vs 7.2 - different query plan, bad performance Message-ID: <20030616063850.GA31813@siaco.id.pl> References: <20030613184506.GE21614@siaco.id.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: X-My-GPG-Key: echo | mail -s "send key pub" ryszard@lach.name User-Agent: Mutt/1.5.4i X-Archive-Number: 200306/81 X-Sequence-Number: 2165 On Sun, Jun 15, 2003 at 09:48:08PM +0200, Manfred Koizar wrote: > On Fri, 13 Jun 2003 20:45:06 +0200, Ryszard Lach > wrote: > >I have a problem with performance after upgrading from 7.2 to 7.3. > > Try > VACUUM ANALYSE; > > and then re-run your query. If it is still slow, post the new EXPLAIN > ANALYSE output here. > Hm. I've tried it too. I don't see a big difference: siaco=# explain analyze select count(*) from v_c; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=210.83..210.83 rows=1 width=8) (actual time=5418.09..5418.09 rows=1 loops=1) -> Subquery Scan v_c (cost=28.40..197.63 rows=5281 width=8) (actual time=4.59..5414.13 rows=5281 loops=1) -> Hash Join (cost=28.40..197.63 rows=5281 width=8) (actual time=4.58..5407.73 rows=5281 loops=1) Hash Cond: ("outer".id = "inner".id) -> Seq Scan on b t1 (cost=0.00..76.81 rows=5281 width=4) (actual time=0.01..9.68 rows=5281 loops=1) -> Hash (cost=24.32..24.32 rows=1632 width=4) (actual time=3.29..3.29 rows=0 loops=1) -> Seq Scan on a t2 (cost=0.00..24.32 rows=1632 width=4) (actual time=0.01..1.88 rows=1632 loops=1) SubPlan -> Aggregate (cost=28.41..28.41 rows=1 width=0) (actual time=1.02..1.02 rows=1 loops=5281) -> Seq Scan on a t3 (cost=0.00..28.40 rows=3 width=0) (actual time=0.76..1.01 rows=1 loops=5281) Filter: (parent_id = $0) Total runtime: 5433.65 msec -- "First they ignore you. Then they laugh at you. Then they fight you. Then you win." - Mohandas Gandhi.