Search Postgresql Archives

Re: More statistics?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



john@xxxxxxxxx ("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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux