Re: More statistics?

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: More statistics?
Date: 2005-09-05 17:48:32
Message-ID: 60oe77mmmn.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

john(at)mitre(dot)org ("John D. Burger") writes:
>> Have you set your stats appropriately?
>
> I've been wondering about how high to set these - is there any
> performance downside to pumping up the statistics count on a table?
> I presume ANALYZE will take longer, and the planner might take a
> tiny bit longer, but otherwise, it can't hurt, correct?

Ten times bigger means collecting ~10x the stats, so yeah, that'll
take longer. The planner shouldn't take materially longer; it's a
"bump up" in the number of "bins."

The *real* issue is whether you can afford to *not* increase the
stats...

The usual default is 10 bins in the histogram.

It seems rare for increasing the number of bins to help change query
plans unless the number of bins is increased to 100 or more.

I'd be inclined to jump straight to 100 for cases where the query
planner seems to be getting things wrong with stats set to 10...
--
"cbbrowne","@","cbbrowne.com"
http://cbbrowne.com/info/wp.html
"Of course, to join the NSA, all you really have to do is pick up any
phone, anywhere, make a long-distance call, and say `National Security
Agency, I'd like a job.' They'll check you out and either give you a
job, or do a job on you." -- David Palmer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2005-09-05 19:10:29 Re: PLPGSQL function schema or table parameter
Previous Message Sidnei de Souza 2005-09-05 17:26:31 PLPGSQL function schema or table parameter