Re: Patch: Tie stats options to autovacuum in

Lists: pgsql-hackerspgsql-patches
From: David Wheeler <david(at)kineticode(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Patch: Tie stats options to autovacuum in postgresql.conf
Date: 2006-09-28 22:07:39
Message-ID: C1A99EB4-2A03-42B3-8BB6-32BECF7BC9E0@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

PostgreSQLers,

I just ran into an issue where a client thought that autovacuum was
running but it wasn't. This is because it's not fatal when autovacuum
is on but stats_start_collector and/or stats_row_level is off. I
suspect that there's a reason that it's not fatal, so I thought that
it might be useful to give folks just a little bit of help by telling
them in postgresql.conf that they need to enable them in order for
autovacuum to work.

If this patch is not correctly formatted or against the proper file,
please let me know and I'll make the necessary modifications.

Thanks,

David

Attachment Content-Type Size
vacuam_stats.patch application/octet-stream 827 bytes

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: David Wheeler <david(at)kineticode(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in postgresql.conf
Date: 2006-09-28 23:39:15
Message-ID: 20060928233915.GG34238@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Thu, Sep 28, 2006 at 03:07:39PM -0700, David Wheeler wrote:
> PostgreSQLers,
>
> I just ran into an issue where a client thought that autovacuum was
> running but it wasn't. This is because it's not fatal when autovacuum
> is on but stats_start_collector and/or stats_row_level is off. I
> suspect that there's a reason that it's not fatal, so I thought that
> it might be useful to give folks just a little bit of help by telling
> them in postgresql.conf that they need to enable them in order for
> autovacuum to work.

+1. I was just at a client today that had run into this problem.

Actually, I'm in favor of refusing to start if autovac is on but the
proper stats settings aren't. I'd rather that then people ending up with
bloated databases and crappy performance.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in postgresql.conf
Date: 2006-09-28 23:46:12
Message-ID: 3A1F2074-9F92-41D2-81D4-FF13BB559770@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Sep 28, 2006, at 16:39, Jim C. Nasby wrote:

> +1. I was just at a client today that had run into this problem.
>
> Actually, I'm in favor of refusing to start if autovac is on but the
> proper stats settings aren't. I'd rather that then people ending up
> with
> bloated databases and crappy performance.

I agree, but I figured that this was a start, at least.

Best,

David


From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
Cc: David Wheeler <david(at)kineticode(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in postgresql.conf
Date: 2006-09-29 02:21:20
Message-ID: 451C8320.4080300@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Jim C. Nasby wrote:
> On Thu, Sep 28, 2006 at 03:07:39PM -0700, David Wheeler wrote:
>> PostgreSQLers,
>>
>> I just ran into an issue where a client thought that autovacuum was
>> running but it wasn't. This is because it's not fatal when autovacuum
>> is on but stats_start_collector and/or stats_row_level is off. I
>> suspect that there's a reason that it's not fatal, so I thought that
>> it might be useful to give folks just a little bit of help by telling
>> them in postgresql.conf that they need to enable them in order for
>> autovacuum to work.
>
> +1. I was just at a client today that had run into this problem.
>
> Actually, I'm in favor of refusing to start if autovac is on but the
> proper stats settings aren't. I'd rather that then people ending up with
> bloated databases and crappy performance.
If think that setting autovacuum to on should even force
stats_collector and stats_row_level to on - together with a warning if
they would otherwise be off.

The risk of autovacuum being disabled by accident seems to risk a much
worse performance penatly then having the statistics collector running
by accident. Additionally, the statistics collector can easily be turned
off within seconds even _if_ it was on accidentally, but if vacuuming was
disabled by accident, the user might have to run "vacuum full" - with all
the concurrency issues that this implies..

greetings, Florian flug


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: David Wheeler <david(at)kineticode(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Patch: Tie stats options to autovacuum in
Date: 2006-10-03 00:40:06
Message-ID: 200610030040.k930e6Z24030@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Modified wording patch applied. Thanks.

---------------------------------------------------------------------------

David Wheeler wrote:
> PostgreSQLers,
>
> I just ran into an issue where a client thought that autovacuum was
> running but it wasn't. This is because it's not fatal when autovacuum
> is on but stats_start_collector and/or stats_row_level is off. I
> suspect that there's a reason that it's not fatal, so I thought that
> it might be useful to give folks just a little bit of help by telling
> them in postgresql.conf that they need to enable them in order for
> autovacuum to work.
>
> If this patch is not correctly formatted or against the proper file,
> please let me know and I'll make the necessary modifications.
>
> Thanks,
>
> David
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/bjm/diff text/x-diff 841 bytes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in
Date: 2006-10-03 00:41:56
Message-ID: 200610030041.k930fuo24138@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

David E. Wheeler wrote:
> On Sep 28, 2006, at 16:39, Jim C. Nasby wrote:
>
> > +1. I was just at a client today that had run into this problem.
> >
> > Actually, I'm in favor of refusing to start if autovac is on but the
> > proper stats settings aren't. I'd rather that then people ending up
> > with
> > bloated databases and crappy performance.
>
> I agree, but I figured that this was a start, at least.

The problem with refusing to start is that autovacuum is sighup, so you
might modify postgresql.conf and do a server restart, and then the
server doesn't start. Are people OK with that?

I did apply the postgresql.conf comment addition.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Patch: Tie stats options to autovacuum in postgresql.conf
Date: 2006-10-03 00:42:33
Message-ID: D53AA9E9-9153-4941-A1E0-BDA5EE169DC3@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Oct 2, 2006, at 17:40, Bruce Momjian wrote:

> Modified wording patch applied. Thanks.

Great, thanks Bruce.

Best,

David


From: Jim Nasby <jim(at)nasby(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in
Date: 2006-10-03 01:10:15
Message-ID: 107D9A98-90FE-41F5-A210-F937501ED891@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Oct 2, 2006, at 8:41 PM, Bruce Momjian wrote:
> David E. Wheeler wrote:
>> On Sep 28, 2006, at 16:39, Jim C. Nasby wrote:
>>
>>> +1. I was just at a client today that had run into this problem.
>>>
>>> Actually, I'm in favor of refusing to start if autovac is on but the
>>> proper stats settings aren't. I'd rather that then people ending up
>>> with
>>> bloated databases and crappy performance.
>>
>> I agree, but I figured that this was a start, at least.
>
> The problem with refusing to start is that autovacuum is sighup, so
> you
> might modify postgresql.conf and do a server restart, and then the
> server doesn't start. Are people OK with that?
>
> I did apply the postgresql.conf comment addition.

Hrm... how about if the options are incompatible on HUP we refuse to
pick up any new settings and complain loudly?

Perhaps it would be easier to just override stats_row_level if
autovac is on. Doesn't necessarily meet the least surprise test, but
it does protect newbies which I feel is more important in this case.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in
Date: 2006-10-03 01:17:52
Message-ID: 200610030117.k931Hq629802@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Jim Nasby wrote:
> On Oct 2, 2006, at 8:41 PM, Bruce Momjian wrote:
> > David E. Wheeler wrote:
> >> On Sep 28, 2006, at 16:39, Jim C. Nasby wrote:
> >>
> >>> +1. I was just at a client today that had run into this problem.
> >>>
> >>> Actually, I'm in favor of refusing to start if autovac is on but the
> >>> proper stats settings aren't. I'd rather that then people ending up
> >>> with
> >>> bloated databases and crappy performance.
> >>
> >> I agree, but I figured that this was a start, at least.
> >
> > The problem with refusing to start is that autovacuum is sighup, so
> > you
> > might modify postgresql.conf and do a server restart, and then the
> > server doesn't start. Are people OK with that?
> >
> > I did apply the postgresql.conf comment addition.
>
> Hrm... how about if the options are incompatible on HUP we refuse to
> pick up any new settings and complain loudly?

We don't read postgresql.conf as a test and then set values.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Jim Nasby <jim(at)nasby(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in
Date: 2006-10-03 01:43:01
Message-ID: 6160E6BB-1674-490C-BBD3-95374AF4818A@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Oct 2, 2006, at 9:17 PM, Bruce Momjian wrote:
> Jim Nasby wrote:
>> On Oct 2, 2006, at 8:41 PM, Bruce Momjian wrote:
>>> David E. Wheeler wrote:
>>>> On Sep 28, 2006, at 16:39, Jim C. Nasby wrote:
>>>>
>>>>> +1. I was just at a client today that had run into this problem.
>>>>>
>>>>> Actually, I'm in favor of refusing to start if autovac is on
>>>>> but the
>>>>> proper stats settings aren't. I'd rather that then people
>>>>> ending up
>>>>> with
>>>>> bloated databases and crappy performance.
>>>>
>>>> I agree, but I figured that this was a start, at least.
>>>
>>> The problem with refusing to start is that autovacuum is sighup, so
>>> you
>>> might modify postgresql.conf and do a server restart, and then the
>>> server doesn't start. Are people OK with that?
>>>
>>> I did apply the postgresql.conf comment addition.
>>
>> Hrm... how about if the options are incompatible on HUP we refuse to
>> pick up any new settings and complain loudly?
>
> We don't read postgresql.conf as a test and then set values.

IMHO we should... if something got botched in the config file I'd
rather have it complain and not change anything instead of taking
just some of the changes. This will be even more important once the
code goes in to return to default values if something gets commented
out in the config.
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Tie stats options to autovacuum in
Date: 2006-10-03 01:54:14
Message-ID: 17943.1159840454@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Jim Nasby <jim(at)nasby(dot)net> writes:
> On Oct 2, 2006, at 9:17 PM, Bruce Momjian wrote:
>> Jim Nasby wrote:
>>> Hrm... how about if the options are incompatible on HUP we refuse to
>>> pick up any new settings and complain loudly?
>>
>> We don't read postgresql.conf as a test and then set values.

> IMHO we should... if something got botched in the config file I'd
> rather have it complain and not change anything instead of taking
> just some of the changes.

Apparently, neither of you have read the code nor experimented with this
behavior.

The core reason why GUC variables should not be interdependent (as Jim
proposed upthread) is exactly that it would break the ability of
ProcessConfigFile to validate the new settings before applying them.

regards, tom lane