postgresql/src/backend
Daniel Gustafsson 7d71d3dd08 Refresh cost-based delay params more frequently in autovacuum
Allow autovacuum to reload the config file more often so that cost-based
delay parameters can take effect while VACUUMing a relation. Previously,
autovacuum workers only reloaded the config file once per relation
vacuumed, so config changes could not take effect until beginning to
vacuum the next table.

Now, check if a reload is pending roughly once per block, when checking
if we need to delay.

In order for autovacuum workers to safely update their own cost delay
and cost limit parameters without impacting performance, we had to
rethink when and how these values were accessed.

Previously, an autovacuum worker's wi_cost_limit was set only at the
beginning of vacuuming a table, after reloading the config file.
Therefore, at the time that autovac_balance_cost() was called, workers
vacuuming tables with no cost-related storage parameters could still
have different values for their wi_cost_limit_base and wi_cost_delay.

Now that the cost parameters can be updated while vacuuming a table,
workers will (within some margin of error) have no reason to have
different values for cost limit and cost delay (in the absence of
cost-related storage parameters). This removes the rationale for keeping
cost limit and cost delay in shared memory. Balancing the cost limit
requires only the number of active autovacuum workers vacuuming a table
with no cost-based storage parameters.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAAKRu_ZngzqnEODc7LmS1NH04Kt6Y9huSjz5pp7%2BDXhrjDA0gw%40mail.gmail.com
2023-04-07 01:00:21 +02:00
..
access Refresh cost-based delay params more frequently in autovacuum 2023-04-07 01:00:21 +02:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Support long distance matching for zstd compression 2023-04-06 17:18:42 +02:00
bootstrap Fix CREATE INDEX progress reporting for multi-level partitioning. 2023-03-25 15:34:03 -04:00
catalog Update information_schema for SQL:2023 2023-04-05 09:57:44 +02:00
commands Refresh cost-based delay params more frequently in autovacuum 2023-04-07 01:00:21 +02:00
executor Fix row tracking in pg_stat_statements with extended query protocol 2023-04-06 09:29:03 +09:00
foreign Update copyright for 2023 2023-01-02 15:00:37 -05:00
jit SQL/JSON: support the IS JSON predicate 2023-03-31 22:34:04 +02:00
lib Fix ILIST_DEBUG build 2023-01-18 10:26:15 -08:00
libpq Make SCRAM iteration count configurable 2023-03-27 09:46:29 +02:00
main Mark options as deprecated in usage output 2023-03-02 14:36:37 +01:00
nodes Code review for recent SQL/JSON commits 2023-04-04 14:04:30 +02:00
optimizer Support "Right Anti Join" plan shapes. 2023-04-05 16:59:09 -04:00
parser Code review for recent SQL/JSON commits 2023-04-04 14:04:30 +02:00
partitioning Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
po meson: add install-{quiet, world} targets 2023-03-23 21:20:18 -07:00
port Update copyright for 2023 2023-01-02 15:00:37 -05:00
postmaster Refresh cost-based delay params more frequently in autovacuum 2023-04-07 01:00:21 +02:00
regex Refactor to introduce pg_locale_deterministic(). 2023-02-23 11:17:41 -08:00
replication Add a run_as_owner option to subscriptions. 2023-04-04 12:03:03 -04:00
rewrite Fix more bugs caused by adding columns to the end of a view. 2023-03-07 18:21:53 -05:00
snowball Update copyright for 2023 2023-01-02 15:00:37 -05:00
statistics Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
storage Use ExtendBufferedRelTo() in {vm,fsm}_extend() 2023-04-05 17:50:09 -07:00
tcop When using valgrind, log the current query after an error is detected. 2023-04-03 10:18:38 -04:00
tsearch Fix ts_headline() edge cases for empty query and empty search text. 2023-04-06 15:52:44 -04:00
utils bufmgr: Introduce infrastructure for faster relation extension 2023-04-05 16:21:09 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Redesign archive modules 2023-02-17 14:26:42 +09:00
meson.build meson: Prevent installation of test files during main install 2023-03-03 07:45:52 +01:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00