Fractions in GUC variables

Lists: pgsql-hackers
From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Fractions in GUC variables
Date: 2007-06-14 12:21:35
Message-ID: 467132CF.9020501@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

We have these GUC variables that define a fraction of something:

#autovacuum_vacuum_scale_factor = 0.2 # fraction of rel size before
# vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of rel size before
# analyze

#bgwriter_lru_percent = 1.0 # 0-100% of LRU buffers scanned/round
#bgwriter_all_percent = 0.333 # 0-100% of all buffers scanned/round

Autovacuum settings use fractions, and bgwriter settings use a
percentage. Fortunately these settings are not related so there's not
too much potential for confusion, but it seems we should have a common
way to define settings like that.

A nice way would be that the base unit would be a fraction, like in the
autovacuum settings, but you could add a %-sign to give it as a percent,
just like you can use KB/MB etc. I'm not sure if we can do anything for
those without breaking backwards-compatibility, though.

Any ideas? The load distributed checkpoints patch adds one more GUC
variable like. I'm inclined to follow the example of the bgwriter
settings because it's more closely related to them, though I like the
autovacuum style more.

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


From: Jim Nasby <decibel(at)decibel(dot)org>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fractions in GUC variables
Date: 2007-06-15 22:14:34
Message-ID: 66EAB09A-0B5A-4C42-98B7-9CF13F687650@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jun 14, 2007, at 7:21 AM, Heikki Linnakangas wrote:
> We have these GUC variables that define a fraction of something:
>
> #autovacuum_vacuum_scale_factor = 0.2 # fraction of rel size before
> # vacuum
> #autovacuum_analyze_scale_factor = 0.1 # fraction of rel size before
> # analyze
>
> #bgwriter_lru_percent = 1.0 # 0-100% of LRU buffers scanned/round
> #bgwriter_all_percent = 0.333 # 0-100% of all buffers scanned/round
>
> Autovacuum settings use fractions, and bgwriter settings use a
> percentage. Fortunately these settings are not related so there's
> not too much potential for confusion, but it seems we should have a
> common way to define settings like that.
>
> A nice way would be that the base unit would be a fraction, like in
> the autovacuum settings, but you could add a %-sign to give it as a
> percent, just like you can use KB/MB etc. I'm not sure if we can do
> anything for those without breaking backwards-compatibility, though.
>
> Any ideas? The load distributed checkpoints patch adds one more GUC
> variable like. I'm inclined to follow the example of the bgwriter
> settings because it's more closely related to them, though I like
> the autovacuum style more.

We could create bgwrite_*_fraction (portion?) and deprecate
bgwriter_*_percent...
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fractions in GUC variables
Date: 2007-07-17 04:48:55
Message-ID: 200707170448.l6H4mtg04616@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

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

Heikki Linnakangas wrote:
> We have these GUC variables that define a fraction of something:
>
> #autovacuum_vacuum_scale_factor = 0.2 # fraction of rel size before
> # vacuum
> #autovacuum_analyze_scale_factor = 0.1 # fraction of rel size before
> # analyze
>
> #bgwriter_lru_percent = 1.0 # 0-100% of LRU buffers scanned/round
> #bgwriter_all_percent = 0.333 # 0-100% of all buffers scanned/round
>
> Autovacuum settings use fractions, and bgwriter settings use a
> percentage. Fortunately these settings are not related so there's not
> too much potential for confusion, but it seems we should have a common
> way to define settings like that.
>
> A nice way would be that the base unit would be a fraction, like in the
> autovacuum settings, but you could add a %-sign to give it as a percent,
> just like you can use KB/MB etc. I'm not sure if we can do anything for
> those without breaking backwards-compatibility, though.
>
> Any ideas? The load distributed checkpoints patch adds one more GUC
> variable like. I'm inclined to follow the example of the bgwriter
> settings because it's more closely related to them, though I like the
> autovacuum style more.
>
> --
> Heikki Linnakangas
> EnterpriseDB http://www.enterprisedb.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

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

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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fractions in GUC variables
Date: 2008-03-11 20:16:46
Message-ID: 200803112016.m2BKGkw13605@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Added to TODO:

o Consider normalizing fractions in postgresql.conf, perhaps
using '%'

http://archives.postgresql.org/pgsql-hackers/2007-06/msg00550.php

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

Heikki Linnakangas wrote:
> We have these GUC variables that define a fraction of something:
>
> #autovacuum_vacuum_scale_factor = 0.2 # fraction of rel size before
> # vacuum
> #autovacuum_analyze_scale_factor = 0.1 # fraction of rel size before
> # analyze
>
> #bgwriter_lru_percent = 1.0 # 0-100% of LRU buffers scanned/round
> #bgwriter_all_percent = 0.333 # 0-100% of all buffers scanned/round
>
> Autovacuum settings use fractions, and bgwriter settings use a
> percentage. Fortunately these settings are not related so there's not
> too much potential for confusion, but it seems we should have a common
> way to define settings like that.
>
> A nice way would be that the base unit would be a fraction, like in the
> autovacuum settings, but you could add a %-sign to give it as a percent,
> just like you can use KB/MB etc. I'm not sure if we can do anything for
> those without breaking backwards-compatibility, though.
>
> Any ideas? The load distributed checkpoints patch adds one more GUC
> variable like. I'm inclined to follow the example of the bgwriter
> settings because it's more closely related to them, though I like the
> autovacuum style more.
>
> --
> Heikki Linnakangas
> EnterpriseDB http://www.enterprisedb.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

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

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