Re: An Analyze question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nickf(at)ontko(dot)com
Cc: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>, "Ray Ontko" <rayo(at)ontko(dot)com>
Subject: Re: An Analyze question
Date: 2002-04-22 20:32:37
Message-ID: 26317.1019507557@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Nick Fankhauser" <nickf(at)ontko(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeremy Buchmann 2002-04-22 22:17:26 Re: Hardware needed for 15,000,000 record DB?
Previous Message Nick Fankhauser 2002-04-22 19:53:24 Re: An Analyze question