X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9C2D7475F2C for ; Tue, 29 Apr 2003 19:05:53 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id F135B475CBC for ; Tue, 29 Apr 2003 19:05:52 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3TN5rU6018325; Tue, 29 Apr 2003 19:05:53 -0400 (EDT) To: "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" Cc: pgsql-performance@postgresql.org Subject: Re: Query Plan far worse in 7.3.2 than 7.2.1 In-reply-to: <011101c30e68$f056bdb0$0a03a8c0@fejleszt2> References: <00db01c30e54$1ab272d0$0a03a8c0@fejleszt2> <26550.1051627993@sss.pgh.pa.us> <011101c30e68$f056bdb0$0a03a8c0@fejleszt2> Comments: In-reply-to "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" message dated "Tue, 29 Apr 2003 18:03:48 +0200" Date: Tue, 29 Apr 2003 19:05:53 -0400 Message-ID: <18324.1051657553@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-16.3 required=5.0 tests=BAYES_01,IN_REP_TO,REFERENCES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/253 X-Sequence-Number: 1759 "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" writes: > ---------------------------- 7.2.1 PLAN --------------------------------- > -> Seq Scan on valuta (cost=0.00..1.06 rows=6 width=4) (actual time=0.02..0.11 rows=6 loops=2) > > ---------------------------- 7.3.2 PLAN --------------------------------- > -> Seq Scan on valuta (cost=0.00..20.00 rows=1000 width=4) (actual time=0.02..0.06 rows=6 loops=2) Ah, there's the problem. You never vacuumed or analyzed "valuta", so the 7.3 planner didn't know it had only six rows, and chose a plan that was more appropriate for a larger table. The thousand-row estimate is the tipoff, because that's the default assumption when there are no stats. regards, tom lane