From: lcham02 <lukechambers7@gmail.com>
To: pgsql-performance@postgresql.org
Subject: disagreeing query planners
Date: 15 Feb 2005 11:15:55 -0800
Message-ID: <1108494955.402264.279020@l41g2000cwc.googlegroups.com> (raw)
With three databases running the same query, I am receiving greatly
differing results from 2 of the query planners.
-db2 and db3 are slonied copies of db1. The servers have identical
postgresql.conf files but the server hardware differs.
-all appropriate columns are indexed
-vacuum analyze is run nightly on all dbs
Here is a simplified version of the query:
------------------------------------------------------------------------
EXPLAIN ANALYZE
SELECT COUNT(DISTINCT(m_object_paper.id))
FROM m_object_paper, m_assignment, m_class,
r_comment_rubric_user_object
WHERE m_object_paper.assignment=m_assignment.id
AND m_assignment.class=m_class.id
AND m_class.account = 36123
AND m_object_paper.id = r_comment_rubric_user_object.objectid;
------------------------------------------------------------------------
db1 displays a concise query plan of nested loops and index scans
executing in 85 ms.
However, db2's query plan consists of sequential scans and takes 3500
ms to complete.
The strange part is this. Last week, db1 and db3 were in agreement and
executing the more efficient plan. Now, db3 is in agreement with db2
with the less efficient, slower plan.
Are we missing something, what could cause this disagreement?
Thanks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: lukechambers7@gmail.com
Subject: Re: disagreeing query planners
In-Reply-To: <1108494955.402264.279020@l41g2000cwc.googlegroups.com>
References: <1108494955.402264.279020@l41g2000cwc.googlegroups.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox