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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-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

Browse pgsql-hackers by date

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

Browse pgsql-patches by date

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