Re: Query Plan far worse in 7.3.2 than 7.2.1 - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query Plan far worse in 7.3.2 than 7.2.1
Date
Msg-id 18324.1051657553@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query Plan far worse in 7.3.2 than 7.2.1  ("SZŰCS Gábor" <surrano@mailbox.hu>)
Responses Query Plan far worse in 7.3.2 than 7.2.1  ("Peter Darley" <pdarley@kinesis-cem.com>)
List pgsql-performance
"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <surrano@mailbox.hu> 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.06rows=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


pgsql-performance by date:

Previous
From: "SZŰCS Gábor"
Date:
Subject: Re: Query Plan far worse in 7.3.2 than 7.2.1
Next
From: "Jim C. Nasby"
Date:
Subject: Why LIMIT after scanning the table?