Re: Understanding histograms - Mailing list pgsql-performance

From Gregory Stark
Subject Re: Understanding histograms
Date
Msg-id 87skx24zfr.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Understanding histograms  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Understanding histograms
List pgsql-performance
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Right.  As a matter of policy we never estimate less than one matching
> row; and I've seriously considered pushing that up to at least two rows
> except when we see that the query condition matches a unique constraint.
> You can get really bad join plans from overly-small estimates.

This is something that needs some serious thought though. In the case of
partitioned tables I've seen someone get badly messed up plans because they
had a couple hundred partitions each of which estimated to return 1 row. In
fact of course they all returned 0 rows except the correct partition. (This
was in a join so no constraint exclusion)

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's 24x7 Postgres support!

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Understanding histograms
Next
From: "Marc G. Fournier"
Date:
Subject: Please ignore ...