Re: [osdldbt-general] Re: [GENERAL] how to get accurate

From: Mary Edie Meredith <maryedie(at)osdl(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>, osdldbt-general <osdldbt-general(at)lists(dot)sourceforge(dot)net>
Subject: Re: [osdldbt-general] Re: [GENERAL] how to get accurate
Date: 2003-09-11 00:17:15
Message-ID: 1063239434.14271.8130.camel@ibm-e.pdx.osdl.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

We tried 1000 as the default and found that the plans were good plans
and were consistent, but the pg_statistics was not exactly the same.

We took Tom's' advice and tried SET SEED=0 (actually select setseed (0)
).

We did runs last night on our project machine which produced consistent
pg_statistics data and (of course) the same plans.

We will next try runs where we vary the default buckets. Other than 10
and 1000, what numbers would you like us to try besides. Previously the
number 100 was mentioned. Are there others?

On Wed, 2003-09-10 at 12:44, Bruce Momjian wrote:
> Tom Lane wrote:
> > Mary Edie Meredith <maryedie(at)osdl(dot)org> writes:
> > > Stephan Szabo kindly responded to our earlier queries suggesting we look
> > > at default_statistics_target and ALTER TABLE ALTER COLUMN SET
> > > STATISTICS.
> >
> > > These determine the number of bins in the histogram for a given column.
> > > But for a large number of rows (for example 6 million) the maximum value
> > > (1000) does not guarantee that ANALYZE will do a full scan of the table.
> > > We do not see a way to guarantee the same statistics run to run without
> > > forcing ANALYZE to examine every row of every table.
> >
> > Do you actually still have a problem with the plans changing when the
> > stats target is above 100 or so? I think the notion of "force ANALYZE
> > to do a full scan" is inherently wrongheaded ... it certainly would not
> > produce numbers that have anything to do with ordinary practice.
> >
> > If you have data statistics that are so bizarre that the planner still
> > gets things wrong with a target of 1000, then I'd like to know more
> > about why.
>
> Has there been any progress in determining if the number of default
> buckets (10) is the best value?
--
Mary Edie Meredith <maryedie(at)osdl(dot)org>
Open Source Development Lab

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message James Robinson 2003-09-11 01:13:29 Attempt at work around of int4 query won't touch int8 index ...
Previous Message Christopher Browne 2003-09-10 22:22:04 Re: [GENERAL] how to get accurate values in pg_statistic (continued)