pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gregory Stark <stark@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: len@pdx.edu
Cc: len@cs.pdx.edu
Cc: pgsql-performance@postgresql.org
Subject: Re: Understanding histograms
Date: Wed, 30 Apr 2008 20:53:44 -0400
Message-ID: <87skx24zfr.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <26230.1209597464@sss.pgh.pa.us>
References: <4817FC00.50609@cs.pdx.edu>
	<14251.1209532791@sss.pgh.pa.us>
	<c5ee9b8a0804292332q32b468e3ga6b99e25b56c18c7@mail.gmail.com>
	<18628.1209566591@sss.pgh.pa.us>
	<1209595622.14025.112.camel@dogma.ljc.laika.com>
	<26230.1209597464@sss.pgh.pa.us>


"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!



view thread (8+ messages)  latest in thread

Message-ID: <87skx24zfr.fsf@oxford.xeocode.com>
Permalink:  ../87skx24zfr.fsf@oxford.xeocode.com/
Also on:    postgresql.org/message-id/87skx24zfr.fsf@oxford.xeocode.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: stark@enterprisedb.com, tgl@sss.pgh.pa.us, pgsql@j-davis.com, len@pdx.edu, len@cs.pdx.edu
  Subject: Re: Understanding histograms
  In-Reply-To: <87skx24zfr.fsf@oxford.xeocode.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