Re: Optimizer generates bad plans. - Mailing list pgsql-hackers

From Kris Jurka
Subject Re: Optimizer generates bad plans.
Date
Msg-id Pine.LNX.4.33.0209201440090.25412-100000@leary.csoft.net
Whole thread Raw
In response to Re: Optimizer generates bad plans.  (Kris Jurka <books@ejurka.com>)
Responses Re: Optimizer generates bad plans.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On Thu, 19 Sep 2002, Kris Jurka wrote:
>
> On Thu, 19 Sep 2002, Tom Lane wrote:
>
> > Kris Jurka <jurka@ejurka.com> writes:
> > > While adding schema support to the JDBC Driver, I came across a query
> > > which occasionally generates some spectacularly bad plans.
> >
> > Hm, does an ANALYZE help?
> >
>
> Yes, it does, but I don't understand why.  The query is entirely against
> pg_catalog tables which have had all of three tables added to them.  How
> can the new ANALYZE stats be significantly different than what came from
> the ANALYZED template1.
>
> Kris Jurka
>

Looking at the differences in statistics before and after the ANALYZE the
only differences are in correlation.  This comes from initdb around line
1046...

"$PGPATH"/postgres $PGSQL_OPT template1 >/dev/null <<EOF
ANALYZE;
VACUUM FULL FREEZE;
EOF

Could this be done better in the one step VACUUM FULL FREEZE ANALYZE or
ANALYZING after the VACUUM FULL?

Kris Jurka



pgsql-hackers by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: [GENERAL] Memory Errors...
Next
From: Joe Conway
Date:
Subject: Re: Improving speed of copy