Re: Understanding histograms
- From: Gregory Stark <stark(at)enterprisedb(dot)com>
- To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
- Cc: "Jeff Davis" <pgsql(at)j-davis(dot)com>, <len(at)pdx(dot)edu>, <len(at)cs(dot)pdx(dot)edu>, <pgsql-performance(at)postgresql(dot)org>
- Subject: Re: Understanding histograms
- Date: Wed, 30 Apr 2008 20:53:44 -0400
- Message-id: <87skx24zfr.fsf@oxford.xeocode.com> <text/plain>
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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!
Home |
Main Index |
Thread Index