Convert [autovacuum_]vacuum_cost_delay into floating-point GUCs.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Mar 2019 19:01:39 +0000 (15:01 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Mar 2019 19:01:39 +0000 (15:01 -0400)
commitcaf626b2cd471615914986f18282c03c8282a1f4
tree5ab082c6464a79e44e42ad3119a4b4ddd8013b5f
parent28a65fc3607a0f45c39a9418f747459bb4f1592a
Convert [autovacuum_]vacuum_cost_delay into floating-point GUCs.

This change makes it possible to specify sub-millisecond delays,
which work well on most modern platforms, though that was not true
when the cost-delay feature was designed.

To support this without breaking existing configuration entries,
improve guc.c to allow floating-point GUCs to have units.  Also,
allow "us" (microseconds) as an input/output unit for time-unit GUCs.
(It's not allowed as a base unit, at least not yet.)

Likewise change the autovacuum_vacuum_cost_delay reloption to be
floating-point; this forces a catversion bump because the layout of
StdRdOptions changes.

This patch doesn't in itself change the default values or allowed
ranges for these parameters, and it should not affect the behavior
for any already-allowed setting for them.

Discussion: https://postgr.es/m/1798.1552165479@sss.pgh.pa.us
15 files changed:
doc/src/sgml/config.sgml
doc/src/sgml/ref/create_table.sgml
src/backend/access/common/reloptions.c
src/backend/commands/vacuum.c
src/backend/postmaster/autovacuum.c
src/backend/utils/init/globals.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/include/catalog/catversion.h
src/include/miscadmin.h
src/include/postmaster/autovacuum.h
src/include/utils/guc.h
src/include/utils/rel.h
src/test/regress/expected/guc.out
src/test/regress/sql/guc.sql