pg.ddx.io  pgsql-hackers@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: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers@postgresql.org
Cc: Martijn van Oosterhout <kleptog@svana.org>
Subject: Re: Maximum statistics target
Date: Mon, 10 Mar 2008 13:43:09 +0000
Message-ID: <87ejaibspe.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <12262.1205153194@sss.pgh.pa.us>
References: <200803071925.26532.peter_e@gmx.net>
	<20080307184157.GA23644@svana.org>
	<28138.1204926525@sss.pgh.pa.us>
	<200803101136.06204.peter_e@gmx.net>
	<12262.1205153194@sss.pgh.pa.us>

"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Peter Eisentraut <peter_e@gmx.net> writes:
>> Am Freitag, 7. März 2008 schrieb Tom Lane:
>>> IIRC, egjoinsel is one of the weak spots, so tests involving planning of
>>> joins between two tables with large MCV lists would be a good place to
>>> start.
>
>> I have run tests with joining two and three tables with 10 million rows each,
>> and the planning times seem to be virtually unaffected by the statistics 
>> target, for values between 10 and 800000.
>
> It's not possible to believe that you'd not notice O(N^2) behavior for N
> approaching 800000 ;-).  Perhaps your join columns were unique keys, and
> thus didn't have any most-common-values?

We could remove the hard limit on statistics target and impose the limit
instead on the actual size of the arrays. Ie, allow people to specify larger
sample sizes and discard unreasonably large excess data (possibly warning them
when that happens).

That would remove the screw case the original poster had where he needed to
scan a large portion of the table to see at least one of every value even
though there were only 169 distinct values.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's RemoteDBA services!



view thread (13+ messages)  latest in thread

Message-ID: <87ejaibspe.fsf@oxford.xeocode.com>
Permalink:  ../87ejaibspe.fsf@oxford.xeocode.com/
Also on:    postgresql.org/message-id/87ejaibspe.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-hackers@postgresql.org
  Cc: stark@enterprisedb.com, tgl@sss.pgh.pa.us, peter_e@gmx.net, kleptog@svana.org
  Subject: Re: Maximum statistics target
  In-Reply-To: <87ejaibspe.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