From: Michael Fuhr <mike@fuhr.org>
To: Daniel Gish <dan@centrifugesolutions.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Inconsistant query plan
Date: Tue, 24 Jan 2006 16:58:57 -0700
Message-ID: <20060124235857.GA92385@winnie.fuhr.org> (raw)
In-Reply-To: <GJEAKHIALCNFPPGBGEKNEEBDDGAA.dan@centrifugesolutions.com>
References: <GJEAKHIALCNFPPGBGEKNEEBDDGAA.dan@centrifugesolutions.com>
On Tue, Jan 24, 2006 at 04:15:57PM -0700, Daniel Gish wrote:
> We are running Postgresql 8.1, and getting dramatically inconsistant results
> after running VACUUM ANALYZE. Sometimes after analyzing the database, the
> query planner chooses a very efficient plan (15 rows, 4.744 ms), and
> sometimes a terrible one (24 rows, 3536.995 ms). Here's the abbreviated
> query:
>
> SELECT * FROM t1 INNER JOIN (t2 INNER JOIN (t3 INNER JOIN t4 ON t3.gid =
> t4.gid) ON t3.gid = t2.gid) ON t2.eid = t1.eid WHERE ...
How abbreviated is that example? Are you actually joining more
tables than that? In another recent thread varying plans were
attributed to exceeding geqo_threshold:
http://archives.postgresql.org/pgsql-performance/2006-01/msg00132.php
Does your situation look similar?
--
Michael Fuhr
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mike@fuhr.org, dan@centrifugesolutions.com
Subject: Re: Inconsistant query plan
In-Reply-To: <20060124235857.GA92385@winnie.fuhr.org>
* 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