Skip site navigation (1) Skip section navigation (2)

Re: Different query plans for the same query

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: tv(at)fuzzy(dot)cz
Cc: "Hell, Robert" <Robert(dot)Hell(at)fabasoft(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Different query plans for the same query
Date: 2009-09-18 17:50:37
Message-ID: 603c8f070909181050i138f711bsc3f096c5216f922e@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
2009/9/18  <tv(at)fuzzy(dot)cz>:
>> Hi all,
>>
>> on our PostgreSQL 8.3.1 (CentOS 5.3 64-bit) two different query plans
>> for one of our (weird) queries are generated. One of the query plans
>> seems to be good (and is used most of the time). The other one is bad -
>> the query takes about 2 minutes and the database process, which is
>> executing the query, is cpu bound during this time.
>>
>> After several tries I was able to reproduce the problem when executing
>> the query with EXPLAIN ANALYZE. The bad query plan was generated only
>> seconds after the good one was used when executing the query. What's the
>> reasond for the different query plans? Statistics are up to date.
>>
>> ...
>
> Hi,
>
> please, when posting an explain plan, either save it into a file and
> provide a URL (attachments are not allowed here), or use
> explain.depesz.com or something like that. This wrapping makes the plan
> unreadable so it's much more difficult to help you.

Uh, since when are attachments not allowed here?  I completely agree
that line-wrapping is BAD, but I don't agree that pastebin is good.  I
would much rather have the relevant material in the email, or in an
attachment, than in some other web site that may or may not format it
readably, may or may not be easy to cut and paste, and will definitely
not become part of our archives.

...Robert

In response to

pgsql-performance by date

Next:From: Michael KorbakovDate: 2009-09-20 00:08:27
Subject: Planner question - wrong row count estimation
Previous:From: solAris23Date: 2009-09-18 16:06:44
Subject: Index row requires 9324 bytes maximum size is 8191

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group