Re: Inefficient Query Plans

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Luke Chambers" <lukechambers7(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Inefficient Query Plans
Date: 2005-02-23 16:44:15
Message-ID: 20025.1109177055@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Luke Chambers" <lukechambers7(at)gmail(dot)com> writes:
> The following query plans both result from the very same query run on
> different servers. They obviously differ drastically, but I don't why
> as one db is a slonied copy of the other with identical postgresql.conf
> files.

There's an order-of-magnitude difference in the estimated row counts for
some of the joins, so it's hardly surprising that different plans would
be chosen. Assuming that these are exactly the same Postgres version,
the only explanation would be considerably different ANALYZE statistics
stored in the two databases.

> Both databases are vacuum analyzed nightly.

Maybe you should double-check that.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-02-23 16:54:52 Re: subquery vs join on 7.4.5
Previous Message John Allgood 2005-02-23 16:39:27 Peformance Tuning Opterons/ Hard Disk Layout