pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Estimation issue with partitioned tables
Date: Wed, 3 Mar 2010 12:12:40 -0500
Message-ID: <603c8f071003030912k5750abadif64cb36d67ab99ae@mail.gmail.com> (raw)
In-Reply-To: <4B8ACFE7.6040207@agliodbs.com>
References: <4B8ACFE7.6040207@agliodbs.com>

On Sun, Feb 28, 2010 at 3:19 PM, Josh Berkus <josh@agliodbs.com> wrote:
> All,
>
> I'm seeing in a production database two problems with query rowcount
> estimation:
>
> (1) Estimates for the number of rows in an outer join do not take into
> account any constraint exclusion (CE) in operation.
>
> (2) Row estimates do not take into account if the unique indexes on the
> child partitions are different from the master partition (the append
> node).  This is often true, because the key to the master is ( key, ce
> column) and for the children is just ( key ).
>
> The result is that if you do a series of outer joins using the CE
> criterion against partitioned tables, the row estimates you get will be
> several orders of magnitude too high ... and the subsequent query plan
> far too pessimistic.
>
> Anyone else seeing this?  Do any of the 9.0 patches address the above
> issues?

I feel like I've seen these way-too-high row estimates in some other
postings to -performance, but I'm not sure if it was the same issue.
You don't by chance have a RTC? I don't think it's likely fixed in 9.0
but it would be interesting to investigate.

...Robert



view thread (6+ messages)  latest in thread

Message-ID: <603c8f071003030912k5750abadif64cb36d67ab99ae@mail.gmail.com>
Permalink:  ../603c8f071003030912k5750abadif64cb36d67ab99ae@mail.gmail.com/
Also on:    postgresql.org/message-id/603c8f071003030912k5750abadif64cb36d67ab99ae@mail.gmail.com

 · 

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: robertmhaas@gmail.com, josh@agliodbs.com
  Subject: Re: Estimation issue with partitioned tables
  In-Reply-To: <603c8f071003030912k5750abadif64cb36d67ab99ae@mail.gmail.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