pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Cédric Villemain <cedric.villemain.debian@gmail.com>
Cc: Vlad Arkhipov <arhipov@dc.baikal.ru>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimization idea
Date: Fri, 23 Apr 2010 19:09:39 -0400
Message-ID: <m2u603c8f071004231609h25df8463p7e895222c216920a@mail.gmail.com> (raw)
In-Reply-To: <18893.1272063214@sss.pgh.pa.us>
References: <4BD0161A.4010908@dc.baikal.ru>
	<4BD0430C.1050308@2ndquadrant.com>
	<4BD10805.9060004@dc.baikal.ru>
	<y2y603c8f071004230405r5fcef546l3da84c407ce2655a@mail.gmail.com>
	<q2ne94e14cd1004230609u9596f80ve2d126430be8cd86@mail.gmail.com>
	<h2z603c8f071004230636zaec7edf2y2cbc0847ba17cd51@mail.gmail.com>
	<i2ne94e14cd1004231222x5459b076w9d0d9077ad73a57a@mail.gmail.com>
	<u2n603c8f071004231506v1a46e2e1z45e81a4a56eaacc1@mail.gmail.com>
	<18893.1272063214@sss.pgh.pa.us>

On Fri, Apr 23, 2010 at 6:53 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> Hmm.  We currently have a heuristic that we don't record a value as an
>> MCV unless it's more frequent than the average frequency.  When the
>> number of MCVs is substantially smaller than the number of distinct
>> values in the table this is probably a good heuristic, since it
>> prevents us from bothering with the recording of some values that are
>> probably only marginally more interesting than other values we don't
>> have space to record.  But if ndistinct is less than the stats target
>> we could in theory record every value we find in the MCVs table and
>> leave the histogram empty.
>
> Which, in fact, is exactly what we do.  Cf analyze.c lines 2414ff
> (as of CVS HEAD).  The heuristic you mention only gets applied after
> we determine that a complete MCV list won't fit.

Oh, hrmm.  I guess I need to go try to understand this example again, then.

...Robert



view thread (21+ messages)  latest in thread

Message-ID: <m2u603c8f071004231609h25df8463p7e895222c216920a@mail.gmail.com>
Permalink:  ../m2u603c8f071004231609h25df8463p7e895222c216920a@mail.gmail.com/
Also on:    postgresql.org/message-id/m2u603c8f071004231609h25df8463p7e895222c216920a@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: robertmhaas@gmail.com, tgl@sss.pgh.pa.us, cedric.villemain.debian@gmail.com, arhipov@dc.baikal.ru
  Subject: Re: Optimization idea
  In-Reply-To: <m2u603c8f071004231609h25df8463p7e895222c216920a@mail.gmail.com>
  References: <4BD0161A.4010908@dc.baikal.ru> <4BD0430C.1050308@2ndquadrant.com> <4BD10805.9060004@dc.baikal.ru> <y2y603c8f071004230405r5fcef546l3da84c407ce2655a@mail.gmail.com> <q2ne94e14cd1004230609u9596f80ve2d126430be8cd86@mail.gmail.com> <h2z603c8f071004230636zaec7edf2y2cbc0847ba17cd51@mail.gmail.com> <i2ne94e14cd1004231222x5459b076w9d0d9077ad73a57a@mail.gmail.com> <u2n603c8f071004231506v1a46e2e1z45e81a4a56eaacc1@mail.gmail.com> <18893.1272063214@sss.pgh.pa.us> <m2u603c8f071004231609h25df8463p7e895222c216920a@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