pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gerhard Wiesinger <lists@wiesinger.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Andreas Kretschmer <akretschmer@spamfence.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
Date: Mon, 30 Aug 2010 12:22:53 -0400
Message-ID: <11111.1283185373@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.LFD.2.01.1008301808330.31277@bbs.intern>
References: <alpine.LFD.2.01.1008300802300.4121@bbs.intern>
	<20100830072230.GA28373@tux>
	<AANLkTi=Te9ToTG-bqVy+fHQ0wM1YWv0nhBqqYiTk2ePg@mail.gmail.com>
	<alpine.LFD.2.01.1008300956320.19598@bbs.intern>
	<AANLkTik14X_MYoZA5CHNGC8M7Rc0zXrRhoGw6FrfUPXm@mail.gmail.com>
	<alpine.LFD.2.01.1008301808330.31277@bbs.intern>

Gerhard Wiesinger <lists@wiesinger.com> writes:
> I know the drawbacks of an EAV design but I don't want to discuss that. I 
> want to discuss the major performance decrease of PostgreSQL 8.3 
> (performance was ok) to PostgreSQL 8.4 (performance is NOT ok).

> Any further ideas how I can track this down?
> Can someone explain the difference in query plan from an optimizer point 
> of view?

Since you haven't shown us the 8.3 plan, it's kind of hard to speculate ;-)

One thing that jumped out at me was that 8.4 appears to be expecting
multiple matches in each of the left-joined tables, which is why the
total rowcount estimate balloons so fast.  I rather imagine that you are
expecting at most one match in reality, else the query isn't going to
behave nicely.  Is this correct?  Are you *sure* you analyzed all these
tables?  And if that is how the data looks, where is the actual
performance problem?  A bad rowcount estimate isn't in itself going
to kill you.

FWIW, in a similar albeit toy example, I don't see any difference
between the 8.3 and 8.4 plans or cost estimates.

			regards, tom lane



view thread (39+ messages)  latest in thread

Message-ID: <11111.1283185373@sss.pgh.pa.us>
Permalink:  ../11111.1283185373@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11111.1283185373@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, lists@wiesinger.com, pavel.stehule@gmail.com, akretschmer@spamfence.net
  Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
  In-Reply-To: <11111.1283185373@sss.pgh.pa.us>

* 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