Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] Better default_statistics_target

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "Decibel!" <decibel(at)decibel(dot)org>,"Christopher Browne" <cbbrowne(at)gmail(dot)com>,<pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Better default_statistics_target
Date: 2008-01-31 16:55:48
Message-ID: 47A1FD94.2070109@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Kevin Grittner wrote:
>>>> On Wed, Jan 30, 2008 at  8:13 PM, in message
> <d6d6637f0801301813n64fa58eu76385cf8a621907(at)mail(dot)gmail(dot)com>, "Christopher
> Browne" <cbbrowne(at)gmail(dot)com> wrote: 
>  
>> There seems to be *plenty* of evidence out there that the performance
>> penalty would NOT be "essentially zero."
>  
> I can confirm that I have had performance tank because of boosting
> the statistics target for selected columns.  It appeared to be time
> spent in the planning phase, not a bad plan choice.  Reducing the
> numbers restored decent performance.

One idea I've been thinking about is to add a step after the analyze, to 
look at the statistics that was gathered. If it looks like the the 
distribution is pretty flat, reduce the data to a smaller set before 
storing it in pg_statistic.

You would still get the hit of longer ANALYZE time, but at least you 
would avoid the hit on query performance where the higher statistics are 
not helpful. We could also print an INFO line along the lines of "you 
might as well lower the statistics target for this table, because it's 
not helping".

No, I don't know how to determine when you could reduce the data, or how 
to reduce it...

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2008-01-31 17:32:46
Subject: Re: [HACKERS] SSL over Unix-domain sockets
Previous:From: Tom LaneDate: 2008-01-31 16:48:25
Subject: Re: timestamp format bug

pgsql-patches by date

Next:From: Bruce MomjianDate: 2008-01-31 17:32:46
Subject: Re: [HACKERS] SSL over Unix-domain sockets
Previous:From: Gregory StarkDate: 2008-01-31 16:08:38
Subject: Re: {**Spam**} Re: [PATCHES] Proposed patch: synchronized_scanning GUC variable

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group