agora inbox for [email protected]
help / color / mirror / Atom feedRE: [HACKERS] backend freezeing on win32 fixed (I hope ;-) )
793+ messages / 2 participants
[nested] [flat]
* RE: [HACKERS] backend freezeing on win32 fixed (I hope ;-) )
@ 1999-08-17 15:57 Horak Daniel <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Horak Daniel @ 1999-08-17 15:57 UTC (permalink / raw)
To: 'Bruce Momjian' <[email protected]>; +Cc: pgsql-hackers
> > It seems that you have found a bug in the cygipc library. I suggest
> > reporting it to the author of same...
>
> Yes, but can we expect all NT sites to get the patch before using
> PostgreSQL? Is there a workaround we can implement?
The workaround is in my first mail in this thread - it disables the
preallocation of semaphores (storage/lmgr/proc.c/InitProcGlobal()) in the
cygwin port.Some patch that will correct the behavior of IPC library is not
available yet and I don't if it ever can be available (it can be a desing
problem in the library or Windows internals).
Dan
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
* [PATCH v1 3/4] autovac: combine reloptions correctly
@ 2025-06-23 20:16 Nathan Bossart <[email protected]>
0 siblings, 0 replies; 793+ messages in thread
From: Nathan Bossart @ 2025-06-23 20:16 UTC (permalink / raw)
---
src/backend/postmaster/autovacuum.c | 85 +++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3bedca971ff..0d1f4e38b58 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -1873,6 +1873,73 @@ get_database_list(void)
return dblist;
}
+static void
+combine_relopts(StdRdOptions *toast_opts, const StdRdOptions *main_opts)
+{
+ AutoVacOpts *toast_avopts = &toast_opts->autovacuum;
+ const AutoVacOpts *main_avopts = &main_opts->autovacuum;
+
+ /* XXX: need isset_offset to combine "enabled" */
+
+ if (toast_avopts->vacuum_threshold == -1)
+ toast_avopts->vacuum_threshold = main_avopts->vacuum_threshold;
+
+ if (toast_avopts->vacuum_max_threshold == -2)
+ toast_avopts->vacuum_max_threshold = main_avopts->vacuum_max_threshold;
+
+ if (toast_avopts->vacuum_ins_threshold == -2)
+ toast_avopts->vacuum_ins_threshold = main_avopts->vacuum_ins_threshold;
+
+ if (toast_avopts->analyze_threshold == -1)
+ toast_avopts->analyze_threshold = main_avopts->analyze_threshold;
+
+ if (toast_avopts->vacuum_cost_limit == -1)
+ toast_avopts->vacuum_cost_limit = main_avopts->vacuum_cost_limit;
+
+ if (toast_avopts->freeze_min_age == -1)
+ toast_avopts->freeze_min_age = main_avopts->freeze_min_age;
+
+ if (toast_avopts->freeze_max_age == -1)
+ toast_avopts->freeze_max_age = main_avopts->freeze_max_age;
+
+ if (toast_avopts->freeze_table_age == -1)
+ toast_avopts->freeze_table_age = main_avopts->freeze_table_age;
+
+ if (toast_avopts->multixact_freeze_min_age == -1)
+ toast_avopts->multixact_freeze_min_age = main_avopts->multixact_freeze_min_age;
+
+ if (toast_avopts->multixact_freeze_max_age == -1)
+ toast_avopts->multixact_freeze_max_age = main_avopts->multixact_freeze_max_age;
+
+ if (toast_avopts->multixact_freeze_table_age == -1)
+ toast_avopts->multixact_freeze_table_age = main_avopts->multixact_freeze_table_age;
+
+ /* XXX: need isset_offset for log_min_duration */
+
+ if (toast_avopts->vacuum_cost_delay == -1)
+ toast_avopts->vacuum_cost_delay = main_avopts->vacuum_cost_delay;
+
+ if (toast_avopts->vacuum_scale_factor == -1)
+ toast_avopts->vacuum_scale_factor = main_avopts->vacuum_scale_factor;
+
+ if (toast_avopts->vacuum_ins_scale_factor == -1)
+ toast_avopts->vacuum_ins_scale_factor = main_avopts->vacuum_ins_scale_factor;
+
+ if (toast_avopts->analyze_scale_factor == -1)
+ toast_avopts->analyze_scale_factor = main_avopts->analyze_scale_factor;
+
+ /* XXX: need isset_offset for vacuum_index_cleanup */
+
+ if (!toast_opts->vacuum_truncate_set && main_opts->vacuum_truncate_set)
+ {
+ toast_opts->vacuum_truncate = main_opts->vacuum_truncate;
+ toast_opts->vacuum_truncate_set = true;
+ }
+
+ if (toast_opts->vacuum_max_eager_freeze_failure_rate == -1)
+ toast_opts->vacuum_max_eager_freeze_failure_rate = main_opts->vacuum_max_eager_freeze_failure_rate;
+}
+
/*
* Process a database table-by-table
*
@@ -2113,7 +2180,16 @@ do_autovacuum(void)
*/
relopts = (StdRdOptions *) extractRelOptions(tuple, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else
{
av_relation *hentry;
@@ -2733,7 +2809,16 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
*/
relopts = (StdRdOptions *) extractRelOptions(classTup, pg_class_desc, NULL);
if (relopts)
+ {
+ av_relation *hentry;
+ bool found;
+
free_relopts = true;
+
+ hentry = hash_search(table_toast_map, &relid, HASH_FIND, &found);
+ if (found && hentry->ar_hasrelopts)
+ combine_relopts(relopts, &hentry->ar_reloptions);
+ }
else if (classForm->relkind == RELKIND_TOASTVALUE &&
table_toast_map != NULL)
{
--
2.39.5 (Apple Git-154)
--QWBYbd5Ar5k8NvSv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename=v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch
^ permalink raw reply [nested|flat] 793+ messages in thread
end of thread, other threads:[~2025-06-23 20:16 UTC | newest]
Thread overview: 793+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-08-17 15:57 RE: [HACKERS] backend freezeing on win32 fixed (I hope ;-) ) Horak Daniel <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
2025-06-23 20:16 [PATCH v1 3/4] autovac: combine reloptions correctly Nathan Bossart <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox