pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: nickf@ontko.com
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Cc: Ray Ontko <rayo@ontko.com>
Subject: Re: An Analyze question
Date: Mon, 22 Apr 2002 16:32:37 -0400
Message-ID: <26317.1019507557@sss.pgh.pa.us> (raw)
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGIEEDENAA.nickf@ontko.com>
References: <NEBBLAAHGLEEPCGOBHDGIEEDENAA.nickf@ontko.com>

"Nick Fankhauser" <nickf@ontko.com> writes:
> In this case, we've got an unusual distribution that looks like this:

> Among the actors to which cases may be assigned:

> The State gets 10% of the cases
> 8 Judges get 3.5% of the cases each
> 50 Attorneys get about 0.1% each
> The remaining 388,000 actors get about 0.001% each.

> Given this unusual distribution, the planner can't predict well, so we're
> thinking that the best way to handle this is to set up a script to do our
> vacuum analyze, and then update stacommonfrac to be .01 for this particular
> field.

That's probably your best answer for 7.1 --- just force a suitable
fudge-factor into pg_statistic after any VACUUM ANALYZE run.

In 7.2, you could set the statistics target for actor_id to be 60 or 100
or so, and then the system would actually *know* the above distribution,
and moreover would know the names of the judges and the attorneys.
It'll be interesting to see how the plans change depending on whether
you are searching for a judge or not ...

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <26317.1019507557@sss.pgh.pa.us>
Permalink:  ../26317.1019507557@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26317.1019507557@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, nickf@ontko.com, rayo@ontko.com
  Subject: Re: An Analyze question
  In-Reply-To: <26317.1019507557@sss.pgh.pa.us>
  References: <NEBBLAAHGLEEPCGOBHDGIEEDENAA.nickf@ontko.com> <26317.1019507557@sss.pgh.pa.us>

* 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