{"Entry":{"collection":"tool","key":"vacuumdb","name":"vacuumdb","aliases":["vacuumdb"],"metadata":{"aliases":["vacuumdb"],"category":"Client applications","content_hash":"26a67ce7619a36c363132545a2fcc046f53db233977a6e500674c74d5e6bcbc7","derived_content_hash":"ea91fdf2b467e0ca5b672556a14cb1f75a4bd130b6567963b5eab03a30198c47","imported_at":"2026-09-30T00:40:34.769992+08:00","name":"vacuumdb","name_zh":"","slug":"vacuumdb","summary":"vacuumdb — garbage-collect and analyze a PostgreSQL database"}},"Definition":{"Collection":"tool","Key":"vacuumdb","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"vacuumdb","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[{"description":"Default connection parameters","name":"PGDATABASE PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"options":[{"description":"Vacuum all databases.","names":["-a","--all"],"signature":"-a --all"},{"description":"Specifies the Buffer Access Strategy ring buffer size for a given invocation of vacuumdb . This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See VACUUM .","names":["--buffer-usage-limit size"],"signature":"--buffer-usage-limit size"},{"description":"Disable skipping pages based on the contents of the visibility map.","names":["--disable-page-skipping"],"signature":"--disable-page-skipping"},{"description":"Echo the commands that vacuumdb generates and sends to the server.","names":["-e","--echo"],"signature":"-e --echo"},{"description":"Perform “ full ” vacuuming.","names":["-f","--full"],"signature":"-f --full"},{"description":"Aggressively “ freeze ” tuples.","names":["-F","--freeze"],"signature":"-F --freeze"},{"description":"Always remove index entries pointing to dead tuples.","names":["--force-index-cleanup"],"signature":"--force-index-cleanup"},{"description":"Execute the vacuum or analyze commands in parallel by running njobs commands simultaneously. This option may reduce the processing time but it also increases the load on the database server. vacuumdb will open njobs connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Note that using this mode together with the -f ( FULL ) option might cause deadlock failures if certain system catalogs are processed in parallel.","names":["-j njobs","--jobs= njobs"],"signature":"-j njobs --jobs= njobs"},{"description":"Only execute the vacuum or analyze commands on tables with a multixact ID age of at least mxid_age . This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see Section 24.1.5.1 ). For the purposes of this option, the multixact ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by vacuumdb will also process the TOAST table for the relation if necessary, it does not need to be considered separately.","names":["--min-mxid-age mxid_age"],"signature":"--min-mxid-age mxid_age"},{"description":"Only execute the vacuum or analyze commands on tables with a transaction ID age of at least xid_age . This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see Section 24.1.5 ). For the purposes of this option, the transaction ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by vacuumdb will also process the TOAST table for the relation if necessary, it does not need to be considered separately.","names":["--min-xid-age xid_age"],"signature":"--min-xid-age xid_age"},{"description":"Only analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with --analyze-in-stages , this option prevents vacuumdb from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices. This option can only be used in conjunction with --analyze-only or --analyze-in-stages . Note that --missing-stats-only requires SELECT privileges on pg_statistic and pg_statistic_ext_data , which are restricted to superusers by default.","names":["--missing-stats-only"],"signature":"--missing-stats-only"},{"description":"Clean or analyze all tables in schema only. Multiple schemas can be vacuumed by writing multiple -n switches.","names":["-n schema","--schema= schema"],"signature":"-n schema --schema= schema"},{"description":"Do not clean or analyze any tables in schema . Multiple schemas can be excluded by writing multiple -N switches.","names":["-N schema","--exclude-schema= schema"],"signature":"-N schema --exclude-schema= schema"},{"description":"Do not remove index entries pointing to dead tuples.","names":["--no-index-cleanup"],"signature":"--no-index-cleanup"},{"description":"Skip the main relation.","names":["--no-process-main"],"signature":"--no-process-main"},{"description":"Skip the TOAST table associated with the table to vacuum, if any.","names":["--no-process-toast"],"signature":"--no-process-toast"},{"description":"Do not truncate empty pages at the end of the table.","names":["--no-truncate"],"signature":"--no-truncate"},{"description":"Specify the number of parallel workers for parallel vacuum . This allows the vacuum to leverage multiple CPUs to process indexes. See VACUUM .","names":["-P parallel_workers","--parallel= parallel_workers"],"signature":"-P parallel_workers --parallel= parallel_workers"},{"description":"Do not display progress messages.","names":["-q","--quiet"],"signature":"-q --quiet"},{"description":"Skip relations that cannot be immediately locked for processing.","names":["--skip-locked"],"signature":"--skip-locked"},{"description":"Clean or analyze table only. Column names can be specified only in conjunction with the --analyze or --analyze-only options. Multiple tables can be vacuumed by writing multiple -t switches. Tip If you specify columns, you probably have to escape the parentheses from the shell. (See examples below.)","names":["-t table [ ( column [,...]) ]","--table= table [ ( column [,...]) ]"],"signature":"-t table [ ( column [,...]) ] --table= table [ ( column [,...]) ]"},{"description":"Print detailed information during processing.","names":["-v","--verbose"],"signature":"-v --verbose"},{"description":"Print the vacuumdb version and exit.","names":["-V","--version"],"signature":"-V --version"},{"description":"Also calculate statistics for use by the optimizer.","names":["-z","--analyze"],"signature":"-z --analyze"},{"description":"Only calculate statistics for use by the optimizer (no vacuum).","names":["-Z","--analyze-only"],"signature":"-Z --analyze-only"},{"description":"Only calculate statistics for use by the optimizer (no vacuum), like --analyze-only . Run three stages of analyze; the first stage uses the lowest possible statistics target (see default_statistics_target ) to produce usable statistics faster, and subsequent stages build the full statistics. This option is only useful to analyze a database that currently has no statistics or has wholly incorrect ones, such as if it is newly populated from a restored dump or by pg_upgrade . Be aware that running with this option in a database with existing statistics may cause the query optimizer choices to become transiently worse due to the low statistics targets of the early stages.","names":["--analyze-in-stages"],"signature":"--analyze-in-stages"},{"description":"Show help about vacuumdb command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"},{"description":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.","names":["-h host","--host= host"],"signature":"-h host --host= host"},{"description":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.","names":["-p port","--port= port"],"signature":"-p port --port= port"},{"description":"User name to connect as.","names":["-U username","--username= username"],"signature":"-U username --username= username"},{"description":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.","names":["-w","--no-password"],"signature":"-w --no-password"},{"description":"Force vacuumdb to prompt for a password before connecting to a database. This option is never essential, since vacuumdb will automatically prompt for a password if the server demands password authentication. However, vacuumdb will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.","names":["-W","--password"],"signature":"-W --password"},{"description":"When the -a / --all is used, connect to this database to gather the list of databases to vacuum. If not specified, the postgres database will be used, or if that does not exist, template1 will be used. This can be a connection string . If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases.","names":["--maintenance-db= dbname"],"signature":"--maintenance-db= dbname"}],"synopsis":["vacuumdb [ connection-option ...] [ option ...] [ -t | --table table [( column [,...] )] ] ... [ dbname | -a | --all ]","vacuumdb [ connection-option ...] [ option ...] [ -n | --schema schema ] ... [ dbname | -a | --all ]","vacuumdb [ connection-option ...] [ option ...] [ -N | --exclude-schema schema ] ... [ dbname | -a | --all ]"]},"comparison_hash":"c475ca852806a0a70db22a56bbad2d270080a07ee8d55cb7db8335b2d58e171a","description":["vacuumdb — garbage-collect and analyze a PostgreSQL database"],"description_zh":"描述 vacuumdb 是用于清理 PostgreSQL 数据库的工具。 vacuumdb 还会生成供 PostgreSQL 查询优化器使用的内部统计信息。 vacuumdb 是 SQL 命令 VACUUM 的包装器。通过该工具或通过访问服务器的其他方式来清理和分析数据库，在效果上没有区别。 选项 vacuumdb 接受下列命令行参数： -a --all 清理所有数据库。 --buffer-usage-limit size 为一次给定的 vacuumdb 调用指定 缓冲区访问策略（Buffer Access Strategy） 环形缓冲区大小。这个大小用于计算将作为该策略一部分被重用的共享缓冲区数量。参见 VACUUM 。 [ -d ] dbname [ --dbname= ] dbname 当未使用 -a / --all 时，指定要清理或分析的数据库名称。如果未指定，则从环境变量 PGDATABASE 中读取数据库名。如果该变量未设置，则使用连接时指定的用户名。 dbname 可以是 连接字符串 。如果是这样，连接字符串参数将覆盖任何冲突的命令行选项。 --disable-page-skipping 禁止基于可见性映射内容跳过页面。 -e --echo 回显 vacuumdb 生成并发送给服务器的命令。 -f --full 执行 “ 完全 ” 清理。 -F --freeze 激进地 “ 冻结 ” 元组。 --force-index-cleanup 始终删除指向死元组的索引条目。 -j njobs --jobs= njobs 通过同时运行 njobs 条命令，并行执行清理或分析命令。该选项可能会缩短处理时间，但也会增加数据库服务器上的负载。 vacuumdb 将打开 njobs 个到数据库的连接，因此请确保 max_connections 的设置足够高，能够容纳所有这些连接。 注意，如果将此模式与 -f （ FULL ）选项一起使用，某些系统目录被并行处理时可能会因死锁而失败。 --min-mxid-age mxid_age 仅对多事务 ID 年龄至少为 mxid_ag","description_zh_html":"\u003cp\u003e命令行工具 vacuumdb [ connection-option ...] [ option ...] [ -t | --table table [( column [,...] )] ] ... [ dbname | -a | --all ]\nvacuumdb [ connection-option ...] [ option ...] [ -n | --schema schema ] ... [ dbname | -a | --all ]\nvacuumdb [ connection-option ...] [ option ...] [ -N | --exclude-schema schema ] ... [ dbname | -a | --all ]。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 是用于清理 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e\n   数据库的工具。\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 还会生成供\n   \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 查询优化器使用的内部统计信息。\n  \u003c/p\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 是 SQL 命令\n   \u003ca class=\"link\" href=\"/zh/docs/18/sql-vacuum.html\"\u003e\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e\u003c/a\u003e 的包装器。通过该工具或通过访问服务器的其他方式来清理和分析数据库，在效果上没有区别。\n  \u003c/p\u003e\u003c/div\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e选项\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 接受下列命令行参数：\n    \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-a\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--all\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        清理所有数据库。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--buffer-usage-limit \u003cem class=\"replaceable\"\u003e\u003ccode\u003esize\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        为一次给定的 \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 调用指定\u003ca class=\"glossterm\" href=\"/zh/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\"\u003e\u003cem class=\"glossterm\"\u003e\u003c/em\u003e\u003c/a\u003e\u003cem class=\"glossterm\"\u003e\u003ca class=\"glossterm\" href=\"/zh/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\"\u003e缓冲区访问策略（Buffer Access Strategy）\u003c/a\u003e\u003c/em\u003e环形缓冲区大小。这个大小用于计算将作为该策略一部分被重用的共享缓冲区数量。参见 \u003ca class=\"xref\" href=\"/zh/docs/18/sql-vacuum.html\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e[\u003cspan class=\"optional\"\u003e-d\u003c/span\u003e] \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e[\u003cspan class=\"optional\"\u003e--dbname=\u003c/span\u003e]\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        当未使用 \u003ccode class=\"option\"\u003e-a\u003c/code\u003e/\u003ccode class=\"option\"\u003e--all\u003c/code\u003e 时，指定要清理或分析的数据库名称。如果未指定，则从环境变量 \u003ccode class=\"envar\"\u003ePGDATABASE\u003c/code\u003e 中读取数据库名。如果该变量未设置，则使用连接时指定的用户名。\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e 可以是\u003ca class=\"link\" href=\"/zh/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\"\u003e连接字符串\u003c/a\u003e。如果是这样，连接字符串参数将覆盖任何冲突的命令行选项。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable-page-skipping\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        禁止基于可见性映射内容跳过页面。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        回显 \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 生成并发送给服务器的命令。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--full\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        执行\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e完全\u003c/span\u003e”\u003c/span\u003e清理。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-F\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--freeze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        激进地\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e冻结\u003c/span\u003e”\u003c/span\u003e元组。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--force-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        始终删除指向死元组的索引条目。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--jobs=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        通过同时运行 \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e 条命令，并行执行清理或分析命令。该选项可能会缩短处理时间，但也会增加数据库服务器上的负载。\n       \u003c/p\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 将打开\n        \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e 个到数据库的连接，因此请确保 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e 的设置足够高，能够容纳所有这些连接。\n       \u003c/p\u003e\u003cp\u003e\n        注意，如果将此模式与 \u003ccode class=\"option\"\u003e-f\u003c/code\u003e（\u003ccode class=\"literal\"\u003eFULL\u003c/code\u003e）选项一起使用，某些系统目录被并行处理时可能会因死锁而失败。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--min-mxid-age \u003cem class=\"replaceable\"\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        仅对多事务 ID 年龄至少为 \u003cem class=\"replaceable\"\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e\n        的表执行清理或分析命令。此设置可用于优先处理表，以防止多事务 ID 回卷（见\u003ca class=\"xref\" href=\"/zh/docs/18/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND\"\u003e第 24.1.5.1 节\u003c/a\u003e）。\n       \u003c/p\u003e\u003cp\u003e\n        就此选项而言，一个关系的多事务 ID 年龄，是其主关系及其关联的\n        \u003cacronym class=\"acronym\"\u003eTOAST\u003c/acronym\u003e 表（如果存在）年龄中的较大者。由于\n        \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 发出的命令在必要时也会处理该关系的\n        \u003cacronym class=\"acronym\"\u003eTOAST\u003c/acronym\u003e 表，因此无需单独考虑它。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--min-xid-age \u003cem class=\"replaceable\"\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        仅对事务 ID 年龄至少为 \u003cem class=\"replaceable\"\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e 的表执行清理或分析命令。此设置可用于优先处理表，以防止事务 ID 回卷（见\u003ca class=\"xref\" href=\"/zh/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\"\u003e第 24.1.5 节\u003c/a\u003e）。\n       \u003c/p\u003e\u003cp\u003e\n        就此选项而言，一个关系的事务 ID 年龄，是其主关系及其关联的\n        \u003cacronym class=\"acronym\"\u003eTOAST\u003c/acronym\u003e 表（如果存在）年龄中的较大者。由于\n        \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 发出的命令在必要时也会处理该关系的\n        \u003cacronym class=\"acronym\"\u003eTOAST\u003c/acronym\u003e 表，因此无需单独考虑它。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--missing-stats-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        仅分析那些在列、索引表达式或扩展统计信息对象上缺少统计信息的关系。与\n        \u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e 一起使用时，此选项可防止\n        \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 临时用按较低统计目标生成的统计信息替换现有统计信息，从而避免查询优化器短暂地作出更差的选择。\n       \u003c/p\u003e\u003cp\u003e\n        此选项只能与 \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e 或 \u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e 配合使用。\n       \u003c/p\u003e\u003cp\u003e\n        注意，\u003ccode class=\"option\"\u003e--missing-stats-only\u003c/code\u003e 要求拥有\n        \u003ccode class=\"literal\"\u003eSELECT\u003c/code\u003e 权限，以访问\n        \u003ca class=\"link\" href=\"/zh/docs/18/catalog-pg-statistic.html\"\u003e\u003ccode class=\"structname\"\u003epg_statistic\u003c/code\u003e\u003c/a\u003e\n        和\n        \u003ca class=\"link\" href=\"/zh/docs/18/catalog-pg-statistic-ext-data.html\"\u003e\u003ccode class=\"structname\"\u003epg_statistic_ext_data\u003c/code\u003e\u003c/a\u003e，而这些权限默认只授予超级用户。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-n \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        仅清理或分析 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e 中的所有表。可以通过多次指定 \u003ccode class=\"option\"\u003e-n\u003c/code\u003e 来清理多个模式。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        不清理或分析 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e 中的任何表。可以通过多次指定 \u003ccode class=\"option\"\u003e-N\u003c/code\u003e 来排除多个模式。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        不删除指向死元组的索引条目。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-process-main\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        跳过主关系。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-process-toast\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        如果有，跳过与待清理表关联的 TOAST 表。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-truncate\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        不截断表末尾的空页。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P \u003cem class=\"replaceable\"\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--parallel=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定\u003cem class=\"firstterm\"\u003e并行清理\u003c/em\u003e的并行工作进程数量。这样可以让清理利用多个 CPU 处理索引。参见 \u003ca class=\"xref\" href=\"/zh/docs/18/sql-vacuum.html\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-q\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--quiet\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        不显示进度消息。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--skip-locked\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        跳过那些无法立即加锁并进行处理的关系。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--table=\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        仅清理或分析 \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e。只有与 \u003ccode class=\"option\"\u003e--analyze\u003c/code\u003e 或 \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e 选项一起使用时，才能指定列名。可以通过多次指定 \u003ccode class=\"option\"\u003e-t\u003c/code\u003e 来清理多个表。\n       \u003c/p\u003e\u003cdiv class=\"tip\"\u003e\u003ch3 class=\"title\"\u003e提示\u003c/h3\u003e\u003cp\u003e\n         如果指定了列，你很可能需要在 shell 中转义括号。（见下面的示例。）\n        \u003c/p\u003e\u003c/div\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        在处理过程中输出详细信息。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       输出 \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 的版本并退出。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-z\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        同时计算供优化器使用的统计信息。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-Z\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        仅计算供优化器使用的统计信息（不执行清理）。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        类似 \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e，仅计算供优化器使用的统计信息（不执行清理）。该选项会运行三个阶段的分析；第一阶段使用尽可能低的统计目标（见 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET\"\u003edefault_statistics_target\u003c/a\u003e），以便更快地生成可用统计信息，随后的阶段再构建完整统计信息。\n       \u003c/p\u003e\u003cp\u003e\n        此选项仅在分析当前没有统计信息，或现有统计信息完全错误的数据库时才有用，例如数据库刚通过恢复转储重新填充，或刚通过 \u003ccode class=\"command\"\u003epg_upgrade\u003c/code\u003e 升级得到。注意，在已有统计信息的数据库上使用此选项，可能会因为早期阶段采用较低统计目标，导致查询优化器的选择暂时变差。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       显示 \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 命令行参数的帮助并退出。\n       \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 还接受下列用于连接参数的命令行参数：\n    \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--host=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定服务器所在机器的主机名。如果该值以斜杠开头，则它会被用作 Unix 域套接字目录。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--port=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定服务器监听连接所用的 TCP 端口，或本地 Unix 域套接字文件扩展名。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--username=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        连接时使用的用户名。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        绝不提示输入密码。如果服务器要求密码认证，而又无法通过其他方式获得密码，例如\n        \u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e 文件，则连接尝试将失败。此选项可用于无人输入密码的批处理作业和脚本。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        强制 \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 在连接数据库之前提示输入密码。\n       \u003c/p\u003e\u003cp\u003e\n        这个选项绝非必需，因为如果服务器要求密码认证，\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 会自动提示输入密码。不过，\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e 会先浪费一次连接尝试，才得知服务器需要密码。在某些情况下，输入 \u003ccode class=\"option\"\u003e-W\u003c/code\u003e 以避免这次额外的连接尝试是值得的。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--maintenance-db=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        当使用 \u003ccode class=\"option\"\u003e-a\u003c/code\u003e/\u003ccode class=\"option\"\u003e--all\u003c/code\u003e 时，连接到该数据库以收集要清理的数据库列表。如果未指定，则使用 \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e 数据库；若该数据库不存在，则使用\n        \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e。这可以是一个\u003ca class=\"link\" href=\"/zh/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\"\u003e连接字符串\u003c/a\u003e。如果是这样，连接字符串参数将覆盖任何冲突的命令行选项。此外，除数据库名本身外，连接字符串中的其他参数在连接到其他数据库时也会被复用。\n       \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/app-vacuumdb.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","environment":[{"description":"Default connection parameters","name":"PGDATABASE PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"facts":[{"label":"Documented executable","value":"vacuumdb"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Client applications"},{"label":"Option definition groups","value":"33"}],"facts_zh":[{"label":"手册中的可执行程序","value":"vacuumdb"},{"label":"程序版本","value":"18.6"},{"label":"参考清单","value":"客户端程序"},{"label":"选项定义组","value":"33"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-VACUUMDB\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003evacuumdb — garbage-collect and analyze a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.23.4.1\"\u003e\u003ccode class=\"command\"\u003evacuumdb\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode class=\"option\"\u003e-t\u003c/code\u003e | \u003ccode class=\"option\"\u003e--table\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [( \u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...] )] ] ... [ \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode class=\"option\"\u003e-a\u003c/code\u003e | \u003ccode class=\"option\"\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.23.4.2\"\u003e\u003ccode class=\"command\"\u003evacuumdb\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode class=\"option\"\u003e-n\u003c/code\u003e | \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e ] ... [ \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode class=\"option\"\u003e-a\u003c/code\u003e | \u003ccode class=\"option\"\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.23.4.3\"\u003e\u003ccode class=\"command\"\u003evacuumdb\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode class=\"option\"\u003e-N\u003c/code\u003e | \u003ccode class=\"option\"\u003e--exclude-schema\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e ] ... [ \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode class=\"option\"\u003e-a\u003c/code\u003e | \u003ccode class=\"option\"\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e is a utility for cleaning a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database. \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will also generate internal statistics used by the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e query optimizer.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e is a wrapper around the SQL command \u003ca class=\"link\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e\u003c/a\u003e. There is no effective difference between vacuuming and analyzing databases via this utility and via other methods for accessing the server.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-a\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--all\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eVacuum all databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--buffer-usage-limit \u003cem class=\"replaceable\"\u003e\u003ccode\u003esize\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the \u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\"\u003e\u003c/a\u003e\u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" title=\"Buffer Access Strategy\"\u003eBuffer Access Strategy\u003c/a\u003e ring buffer size for a given invocation of \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e. This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See \u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e[\u003cspan class=\"optional\"\u003e-d\u003c/span\u003e] \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e[\u003cspan class=\"optional\"\u003e--dbname=\u003c/span\u003e]\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to be cleaned or analyzed, when \u003ccode class=\"option\"\u003e-a\u003c/code\u003e/\u003ccode class=\"option\"\u003e--all\u003c/code\u003e is not used. If this is not specified, the database name is read from the environment variable \u003ccode class=\"envar\"\u003ePGDATABASE\u003c/code\u003e. If that is not set, the user name specified for the connection is used. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e can be a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e. If so, connection string parameters will override any conflicting command line options.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable-page-skipping\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisable skipping pages based on the contents of the visibility map.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho the commands that \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e generates and sends to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--full\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePerform \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003efull\u003c/span\u003e”\u003c/span\u003e vacuuming.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-F\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--freeze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAggressively \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003efreeze\u003c/span\u003e”\u003c/span\u003e tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--force-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAlways remove index entries pointing to dead tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--jobs=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eExecute the vacuum or analyze commands in parallel by running \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e commands simultaneously. This option may reduce the processing time but it also increases the load on the database server.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will open \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e connections to the database, so make sure your \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e setting is high enough to accommodate all connections.\u003c/p\u003e\n\u003cp\u003eNote that using this mode together with the \u003ccode class=\"option\"\u003e-f\u003c/code\u003e (\u003ccode class=\"literal\"\u003eFULL\u003c/code\u003e) option might cause deadlock failures if certain system catalogs are processed in parallel.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--min-mxid-age \u003cem class=\"replaceable\"\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly execute the vacuum or analyze commands on tables with a multixact ID age of at least \u003cem class=\"replaceable\"\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e. This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see \u003ca class=\"xref\" href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND\" title=\"24.1.5.1. Multixacts and Wraparound\"\u003eSection 24.1.5.1\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFor the purposes of this option, the multixact ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will also process the TOAST table for the relation if necessary, it does not need to be considered separately.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--min-xid-age \u003cem class=\"replaceable\"\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly execute the vacuum or analyze commands on tables with a transaction ID age of at least \u003cem class=\"replaceable\"\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e. This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see \u003ca class=\"xref\" href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\" title=\"24.1.5. Preventing Transaction ID Wraparound Failures\"\u003eSection 24.1.5\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFor the purposes of this option, the transaction ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will also process the TOAST table for the relation if necessary, it does not need to be considered separately.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--missing-stats-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with \u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e, this option prevents \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices.\u003c/p\u003e\n\u003cp\u003eThis option can only be used in conjunction with \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e or \u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eNote that \u003ccode class=\"option\"\u003e--missing-stats-only\u003c/code\u003e requires \u003ccode class=\"literal\"\u003eSELECT\u003c/code\u003e privileges on \u003ca class=\"link\" href=\"/docs/18/catalog-pg-statistic.html\" title=\"52.51. pg_statistic\"\u003e\u003ccode class=\"structname\"\u003epg_statistic\u003c/code\u003e\u003c/a\u003e and \u003ca class=\"link\" href=\"/docs/18/catalog-pg-statistic-ext-data.html\" title=\"52.53. pg_statistic_ext_data\"\u003e\u003ccode class=\"structname\"\u003epg_statistic_ext_data\u003c/code\u003e\u003c/a\u003e, which are restricted to superusers by default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-n \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eClean or analyze all tables in \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e only. Multiple schemas can be vacuumed by writing multiple \u003ccode class=\"option\"\u003e-n\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not clean or analyze any tables in \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e. Multiple schemas can be excluded by writing multiple \u003ccode class=\"option\"\u003e-N\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not remove index entries pointing to dead tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-process-main\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip the main relation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-process-toast\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip the TOAST table associated with the table to vacuum, if any.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-truncate\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not truncate empty pages at the end of the table.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P \u003cem class=\"replaceable\"\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--parallel=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify the number of parallel workers for \u003cem class=\"firstterm\"\u003eparallel vacuum\u003c/em\u003e. This allows the vacuum to leverage multiple CPUs to process indexes. See \u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-q\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--quiet\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not display progress messages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--skip-locked\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip relations that cannot be immediately locked for processing.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--table=\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eClean or analyze \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e only. Column names can be specified only in conjunction with the \u003ccode class=\"option\"\u003e--analyze\u003c/code\u003e or \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e options. Multiple tables can be vacuumed by writing multiple \u003ccode class=\"option\"\u003e-t\u003c/code\u003e switches.\u003c/p\u003e\n\u003cdiv class=\"tip\"\u003e\n\u003ch3 class=\"title\"\u003eTip\u003c/h3\u003e\n\u003cp\u003eIf you specify columns, you probably have to escape the parentheses from the shell. (See examples below.)\u003c/p\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint detailed information during processing.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-z\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAlso calculate statistics for use by the optimizer.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-Z\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly calculate statistics for use by the optimizer (no vacuum).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly calculate statistics for use by the optimizer (no vacuum), like \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e. Run three stages of analyze; the first stage uses the lowest possible statistics target (see \u003ca class=\"xref\" href=\"/docs/18/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET\"\u003edefault_statistics_target\u003c/a\u003e) to produce usable statistics faster, and subsequent stages build the full statistics.\u003c/p\u003e\n\u003cp\u003eThis option is only useful to analyze a database that currently has no statistics or has wholly incorrect ones, such as if it is newly populated from a restored dump or by \u003ccode class=\"command\"\u003epg_upgrade\u003c/code\u003e. Be aware that running with this option in a database with existing statistics may cause the query optimizer choices to become transiently worse due to the low statistics targets of the early stages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e also accepts the following command-line arguments for connection parameters:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--host=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--port=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--username=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e to prompt for a password before connecting to a database.\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode class=\"option\"\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--maintenance-db=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen the \u003ccode class=\"option\"\u003e-a\u003c/code\u003e/\u003ccode class=\"option\"\u003e--all\u003c/code\u003e is used, connect to this database to gather the list of databases to vacuum. If not specified, the \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e database will be used, or if that does not exist, \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e will be used. This can be a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e. If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATABASE\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eIn case of difficulty, see \u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e and \u003ca class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e front-end library will apply.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.9\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo clean the database \u003ccode class=\"literal\"\u003etest\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb test\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean and analyze for the optimizer a database named \u003ccode class=\"literal\"\u003ebigdb\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb --analyze bigdb\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean a single table \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e in a database named \u003ccode class=\"literal\"\u003exyzzy\u003c/code\u003e, and analyze a single column \u003ccode class=\"literal\"\u003ebar\u003c/code\u003e of the table for the optimizer:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb --analyze --verbose --table='foo(bar)' xyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean all tables in the \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e and \u003ccode class=\"literal\"\u003ebar\u003c/code\u003e schemas in a database named \u003ccode class=\"literal\"\u003exyzzy\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb --schema='foo' --schema='bar' xyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-vacuumdb.html","options":[{"description":"Vacuum all databases.","names":["-a","--all"],"signature":"-a --all","source_url":"/docs/18/app-vacuumdb.html","summary":"Vacuum all databases."},{"description":"Specifies the Buffer Access Strategy ring buffer size for a given invocation of vacuumdb . This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See VACUUM .","names":["--buffer-usage-limit size"],"signature":"--buffer-usage-limit size","source_url":"/docs/18/app-vacuumdb.html","summary":"Specifies the Buffer Access Strategy ring buffer size for a given invocation of vacuumdb . This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See VACUUM ."},{"description":"Disable skipping pages based on the contents of the visibility map.","names":["--disable-page-skipping"],"signature":"--disable-page-skipping","source_url":"/docs/18/app-vacuumdb.html","summary":"Disable skipping pages based on the contents of the visibility map."},{"description":"Echo the commands that vacuumdb generates and sends to the server.","names":["-e","--echo"],"signature":"-e --echo","source_url":"/docs/18/app-vacuumdb.html","summary":"Echo the commands that vacuumdb generates and sends to the server."},{"description":"Perform “ full ” vacuuming.","names":["-f","--full"],"signature":"-f --full","source_url":"/docs/18/app-vacuumdb.html","summary":"Perform “ full ” vacuuming."},{"description":"Aggressively “ freeze ” tuples.","names":["-F","--freeze"],"signature":"-F --freeze","source_url":"/docs/18/app-vacuumdb.html","summary":"Aggressively “ freeze ” tuples."},{"description":"Always remove index entries pointing to dead tuples.","names":["--force-index-cleanup"],"signature":"--force-index-cleanup","source_url":"/docs/18/app-vacuumdb.html","summary":"Always remove index entries pointing to dead tuples."},{"description":"Execute the vacuum or analyze commands in parallel by running njobs commands simultaneously. This option may reduce the processing time but it also increases the load on the database server. vacuumdb will open njobs connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Note that using this mode together with the -f ( FULL ) option might cause deadlock failures if certain system catalogs are processed in parallel.","names":["-j njobs","--jobs= njobs"],"signature":"-j njobs --jobs= njobs","source_url":"/docs/18/app-vacuumdb.html","summary":"Execute the vacuum or analyze commands in parallel by running njobs commands simultaneously. This option may reduce the processing time but it also increases the load on the database server."},{"description":"Only execute the vacuum or analyze commands on tables with a multixact ID age of at least mxid_age . This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see Section 24.1.5.1 ). For the purposes of this option, the multixact ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by vacuumdb will also process the TOAST table for the relation if necessary, it does not need to be considered separately.","names":["--min-mxid-age mxid_age"],"signature":"--min-mxid-age mxid_age","source_url":"/docs/18/app-vacuumdb.html","summary":"Only execute the vacuum or analyze commands on tables with a multixact ID age of at least mxid_age . This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see Section 24.1.5.1 )."},{"description":"Only execute the vacuum or analyze commands on tables with a transaction ID age of at least xid_age . This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see Section 24.1.5 ). For the purposes of this option, the transaction ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by vacuumdb will also process the TOAST table for the relation if necessary, it does not need to be considered separately.","names":["--min-xid-age xid_age"],"signature":"--min-xid-age xid_age","source_url":"/docs/18/app-vacuumdb.html","summary":"Only execute the vacuum or analyze commands on tables with a transaction ID age of at least xid_age . This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see Section 24.1.5 )."},{"description":"Only analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with --analyze-in-stages , this option prevents vacuumdb from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices. This option can only be used in conjunction with --analyze-only or --analyze-in-stages . Note that --missing-stats-only requires SELECT privileges on pg_statistic and pg_statistic_ext_data , which are restricted to superusers by default.","names":["--missing-stats-only"],"signature":"--missing-stats-only","source_url":"/docs/18/app-vacuumdb.html","summary":"Only analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with --analyze-in-stages , this option prevents vacuumdb from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices."},{"description":"Clean or analyze all tables in schema only. Multiple schemas can be vacuumed by writing multiple -n switches.","names":["-n schema","--schema= schema"],"signature":"-n schema --schema= schema","source_url":"/docs/18/app-vacuumdb.html","summary":"Clean or analyze all tables in schema only. Multiple schemas can be vacuumed by writing multiple -n switches."},{"description":"Do not clean or analyze any tables in schema . Multiple schemas can be excluded by writing multiple -N switches.","names":["-N schema","--exclude-schema= schema"],"signature":"-N schema --exclude-schema= schema","source_url":"/docs/18/app-vacuumdb.html","summary":"Do not clean or analyze any tables in schema . Multiple schemas can be excluded by writing multiple -N switches."},{"description":"Do not remove index entries pointing to dead tuples.","names":["--no-index-cleanup"],"signature":"--no-index-cleanup","source_url":"/docs/18/app-vacuumdb.html","summary":"Do not remove index entries pointing to dead tuples."},{"description":"Skip the main relation.","names":["--no-process-main"],"signature":"--no-process-main","source_url":"/docs/18/app-vacuumdb.html","summary":"Skip the main relation."},{"description":"Skip the TOAST table associated with the table to vacuum, if any.","names":["--no-process-toast"],"signature":"--no-process-toast","source_url":"/docs/18/app-vacuumdb.html","summary":"Skip the TOAST table associated with the table to vacuum, if any."},{"description":"Do not truncate empty pages at the end of the table.","names":["--no-truncate"],"signature":"--no-truncate","source_url":"/docs/18/app-vacuumdb.html","summary":"Do not truncate empty pages at the end of the table."},{"description":"Specify the number of parallel workers for parallel vacuum . This allows the vacuum to leverage multiple CPUs to process indexes. See VACUUM .","names":["-P parallel_workers","--parallel= parallel_workers"],"signature":"-P parallel_workers --parallel= parallel_workers","source_url":"/docs/18/app-vacuumdb.html","summary":"Specify the number of parallel workers for parallel vacuum . This allows the vacuum to leverage multiple CPUs to process indexes. See VACUUM ."},{"description":"Do not display progress messages.","names":["-q","--quiet"],"signature":"-q --quiet","source_url":"/docs/18/app-vacuumdb.html","summary":"Do not display progress messages."},{"description":"Skip relations that cannot be immediately locked for processing.","names":["--skip-locked"],"signature":"--skip-locked","source_url":"/docs/18/app-vacuumdb.html","summary":"Skip relations that cannot be immediately locked for processing."},{"description":"Clean or analyze table only. Column names can be specified only in conjunction with the --analyze or --analyze-only options. Multiple tables can be vacuumed by writing multiple -t switches. Tip If you specify columns, you probably have to escape the parentheses from the shell. (See examples below.)","names":["-t table [ ( column [,...]) ]","--table= table [ ( column [,...]) ]"],"signature":"-t table [ ( column [,...]) ] --table= table [ ( column [,...]) ]","source_url":"/docs/18/app-vacuumdb.html","summary":"Clean or analyze table only. Column names can be specified only in conjunction with the --analyze or --analyze-only options. Multiple tables can be vacuumed by writing multiple -t switches."},{"description":"Print detailed information during processing.","names":["-v","--verbose"],"signature":"-v --verbose","source_url":"/docs/18/app-vacuumdb.html","summary":"Print detailed information during processing."},{"description":"Print the vacuumdb version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-vacuumdb.html","summary":"Print the vacuumdb version and exit."},{"description":"Also calculate statistics for use by the optimizer.","names":["-z","--analyze"],"signature":"-z --analyze","source_url":"/docs/18/app-vacuumdb.html","summary":"Also calculate statistics for use by the optimizer."},{"description":"Only calculate statistics for use by the optimizer (no vacuum).","names":["-Z","--analyze-only"],"signature":"-Z --analyze-only","source_url":"/docs/18/app-vacuumdb.html","summary":"Only calculate statistics for use by the optimizer (no vacuum)."},{"description":"Only calculate statistics for use by the optimizer (no vacuum), like --analyze-only . Run three stages of analyze; the first stage uses the lowest possible statistics target (see default_statistics_target ) to produce usable statistics faster, and subsequent stages build the full statistics. This option is only useful to analyze a database that currently has no statistics or has wholly incorrect ones, such as if it is newly populated from a restored dump or by pg_upgrade . Be aware that running with this option in a database with existing statistics may cause the query optimizer choices to become transiently worse due to the low statistics targets of the early stages.","names":["--analyze-in-stages"],"signature":"--analyze-in-stages","source_url":"/docs/18/app-vacuumdb.html","summary":"Only calculate statistics for use by the optimizer (no vacuum), like --analyze-only . Run three stages of analyze; the first stage uses the lowest possible statistics target (see default_statistics_target ) to produce usable statistics faster, and subsequent stages build the full statistics."},{"description":"Show help about vacuumdb command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-vacuumdb.html","summary":"Show help about vacuumdb command line arguments, and exit."},{"description":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.","names":["-h host","--host= host"],"signature":"-h host --host= host","source_url":"/docs/18/app-vacuumdb.html","summary":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket."},{"description":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.","names":["-p port","--port= port"],"signature":"-p port --port= port","source_url":"/docs/18/app-vacuumdb.html","summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"description":"User name to connect as.","names":["-U username","--username= username"],"signature":"-U username --username= username","source_url":"/docs/18/app-vacuumdb.html","summary":"User name to connect as."},{"description":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.","names":["-w","--no-password"],"signature":"-w --no-password","source_url":"/docs/18/app-vacuumdb.html","summary":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"description":"Force vacuumdb to prompt for a password before connecting to a database. This option is never essential, since vacuumdb will automatically prompt for a password if the server demands password authentication. However, vacuumdb will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.","names":["-W","--password"],"signature":"-W --password","source_url":"/docs/18/app-vacuumdb.html","summary":"Force vacuumdb to prompt for a password before connecting to a database."},{"description":"When the -a / --all is used, connect to this database to gather the list of databases to vacuum. If not specified, the postgres database will be used, or if that does not exist, template1 will be used. This can be a connection string . If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases.","names":["--maintenance-db= dbname"],"signature":"--maintenance-db= dbname","source_url":"/docs/18/app-vacuumdb.html","summary":"When the -a / --all is used, connect to this database to gather the list of databases to vacuum. If not specified, the postgres database will be used, or if that does not exist, template1 will be used. This can be a connection string . If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"sections_zh":[],"signature":"vacuumdb [ connection-option ...] [ option ...] [ -t | --table table [( column [,...] )] ] ... [ dbname | -a | --all ]\nvacuumdb [ connection-option ...] [ option ...] [ -n | --schema schema ] ... [ dbname | -a | --all ]\nvacuumdb [ connection-option ...] [ option ...] [ -N | --exclude-schema schema ] ... [ dbname | -a | --all ]","sources":[{"anchor":"","file":"app-vacuumdb.html","label":"18.6 English manual · app-vacuumdb.html","sha256":"bf6a6504348c7e0f81a39c49654524dcfebfc8f0ff7340d492daf13c64f76eb9","url":"/docs/18/app-vacuumdb.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}],"synopsis":["vacuumdb [ connection-option ...] [ option ...] [ -t | --table table [( column [,...] )] ] ... [ dbname | -a | --all ]","vacuumdb [ connection-option ...] [ option ...] [ -n | --schema schema ] ... [ dbname | -a | --all ]","vacuumdb [ connection-option ...] [ option ...] [ -N | --exclude-schema schema ] ... [ dbname | -a | --all ]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a --all","url":"/docs/18/app-vacuumdb.html"},"summary":"Vacuum all databases."},{"signature":{"text":"--buffer-usage-limit size","url":"/docs/18/app-vacuumdb.html"},"summary":"Specifies the Buffer Access Strategy ring buffer size for a given invocation of vacuumdb . This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See VACUUM ."},{"signature":{"text":"--disable-page-skipping","url":"/docs/18/app-vacuumdb.html"},"summary":"Disable skipping pages based on the contents of the visibility map."},{"signature":{"text":"-e --echo","url":"/docs/18/app-vacuumdb.html"},"summary":"Echo the commands that vacuumdb generates and sends to the server."},{"signature":{"text":"-f --full","url":"/docs/18/app-vacuumdb.html"},"summary":"Perform “ full ” vacuuming."},{"signature":{"text":"-F --freeze","url":"/docs/18/app-vacuumdb.html"},"summary":"Aggressively “ freeze ” tuples."},{"signature":{"text":"--force-index-cleanup","url":"/docs/18/app-vacuumdb.html"},"summary":"Always remove index entries pointing to dead tuples."},{"signature":{"text":"-j njobs --jobs= njobs","url":"/docs/18/app-vacuumdb.html"},"summary":"Execute the vacuum or analyze commands in parallel by running njobs commands simultaneously. This option may reduce the processing time but it also increases the load on the database server."},{"signature":{"text":"--min-mxid-age mxid_age","url":"/docs/18/app-vacuumdb.html"},"summary":"Only execute the vacuum or analyze commands on tables with a multixact ID age of at least mxid_age . This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see Section 24.1.5.1 )."},{"signature":{"text":"--min-xid-age xid_age","url":"/docs/18/app-vacuumdb.html"},"summary":"Only execute the vacuum or analyze commands on tables with a transaction ID age of at least xid_age . This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see Section 24.1.5 )."},{"signature":{"text":"--missing-stats-only","url":"/docs/18/app-vacuumdb.html"},"summary":"Only analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with --analyze-in-stages , this option prevents vacuumdb from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices."},{"signature":{"text":"-n schema --schema= schema","url":"/docs/18/app-vacuumdb.html"},"summary":"Clean or analyze all tables in schema only. Multiple schemas can be vacuumed by writing multiple -n switches."},{"signature":{"text":"-N schema --exclude-schema= schema","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not clean or analyze any tables in schema . Multiple schemas can be excluded by writing multiple -N switches."},{"signature":{"text":"--no-index-cleanup","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not remove index entries pointing to dead tuples."},{"signature":{"text":"--no-process-main","url":"/docs/18/app-vacuumdb.html"},"summary":"Skip the main relation."},{"signature":{"text":"--no-process-toast","url":"/docs/18/app-vacuumdb.html"},"summary":"Skip the TOAST table associated with the table to vacuum, if any."},{"signature":{"text":"--no-truncate","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not truncate empty pages at the end of the table."},{"signature":{"text":"-P parallel_workers --parallel= parallel_workers","url":"/docs/18/app-vacuumdb.html"},"summary":"Specify the number of parallel workers for parallel vacuum . This allows the vacuum to leverage multiple CPUs to process indexes. See VACUUM ."},{"signature":{"text":"-q --quiet","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not display progress messages."},{"signature":{"text":"--skip-locked","url":"/docs/18/app-vacuumdb.html"},"summary":"Skip relations that cannot be immediately locked for processing."},{"signature":{"text":"-t table [ ( column [,...]) ] --table= table [ ( column [,...]) ]","url":"/docs/18/app-vacuumdb.html"},"summary":"Clean or analyze table only. Column names can be specified only in conjunction with the --analyze or --analyze-only options. Multiple tables can be vacuumed by writing multiple -t switches."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-vacuumdb.html"},"summary":"Print detailed information during processing."},{"signature":{"text":"-V --version","url":"/docs/18/app-vacuumdb.html"},"summary":"Print the vacuumdb version and exit."},{"signature":{"text":"-z --analyze","url":"/docs/18/app-vacuumdb.html"},"summary":"Also calculate statistics for use by the optimizer."},{"signature":{"text":"-Z --analyze-only","url":"/docs/18/app-vacuumdb.html"},"summary":"Only calculate statistics for use by the optimizer (no vacuum)."},{"signature":{"text":"--analyze-in-stages","url":"/docs/18/app-vacuumdb.html"},"summary":"Only calculate statistics for use by the optimizer (no vacuum), like --analyze-only . Run three stages of analyze; the first stage uses the lowest possible statistics target (see default_statistics_target ) to produce usable statistics faster, and subsequent stages build the full statistics."},{"signature":{"text":"-? --help","url":"/docs/18/app-vacuumdb.html"},"summary":"Show help about vacuumdb command line arguments, and exit."},{"signature":{"text":"-h host --host= host","url":"/docs/18/app-vacuumdb.html"},"summary":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-vacuumdb.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"signature":{"text":"-U username --username= username","url":"/docs/18/app-vacuumdb.html"},"summary":"User name to connect as."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-vacuumdb.html"},"summary":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"signature":{"text":"-W --password","url":"/docs/18/app-vacuumdb.html"},"summary":"Force vacuumdb to prompt for a password before connecting to a database."},{"signature":{"text":"--maintenance-db= dbname","url":"/docs/18/app-vacuumdb.html"},"summary":"When the -a / --all is used, connect to this database to gather the list of databases to vacuum. If not specified, the postgres database will be used, or if that does not exist, template1 will be used. This can be a connection string . If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default connection parameters","name":"PGDATABASE PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}],"tables_zh":[{"columns":[{"key":"signature","label":"选项与参数"},{"key":"summary","label":"说明"}],"key":"options","rows":[{"signature":{"text":"-a --all","url":"/docs/18/app-vacuumdb.html"},"summary":"清理所有数据库。"},{"signature":{"text":"--buffer-usage-limit size","url":"/docs/18/app-vacuumdb.html"},"summary":"为一次给定的 vacuumdb 调用指定 缓冲区访问策略（Buffer Access Strategy） 环形缓冲区大小。这个大小用于计算将作为该策略一部分被重用的共享缓冲区数量。参见 VACUUM 。"},{"signature":{"text":"--disable-page-skipping","url":"/docs/18/app-vacuumdb.html"},"summary":"禁止基于可见性映射内容跳过页面。"},{"signature":{"text":"-e --echo","url":"/docs/18/app-vacuumdb.html"},"summary":"回显 vacuumdb 生成并发送给服务器的命令。"},{"signature":{"text":"-f --full","url":"/docs/18/app-vacuumdb.html"},"summary":"执行 “ 完全 ” 清理。"},{"signature":{"text":"-F --freeze","url":"/docs/18/app-vacuumdb.html"},"summary":"激进地 “ 冻结 ” 元组。"},{"signature":{"text":"--force-index-cleanup","url":"/docs/18/app-vacuumdb.html"},"summary":"始终删除指向死元组的索引条目。"},{"signature":{"text":"-j njobs --jobs= njobs","url":"/docs/18/app-vacuumdb.html"},"summary":"通过同时运行 njobs 条命令，并行执行清理或分析命令。该选项可能会缩短处理时间，但也会增加数据库服务器上的负载。"},{"signature":{"text":"--min-mxid-age mxid_age","url":"/docs/18/app-vacuumdb.html"},"summary":"仅对多事务 ID 年龄至少为 mxid_age 的表执行清理或分析命令。此设置可用于优先处理表，以防止多事务 ID 回卷（见 第 24.1.5.1 节 ）。"},{"signature":{"text":"--min-xid-age xid_age","url":"/docs/18/app-vacuumdb.html"},"summary":"仅对事务 ID 年龄至少为 xid_age 的表执行清理或分析命令。此设置可用于优先处理表，以防止事务 ID 回卷（见 第 24.1.5 节 ）。"},{"signature":{"text":"--missing-stats-only","url":"/docs/18/app-vacuumdb.html"},"summary":"仅分析那些在列、索引表达式或扩展统计信息对象上缺少统计信息的关系。与 --analyze-in-stages 一起使用时，此选项可防止 vacuumdb 临时用按较低统计目标生成的统计信息替换现有统计信息，从而避免查询优化器短暂地作出更差的选择。"},{"signature":{"text":"-n schema --schema= schema","url":"/docs/18/app-vacuumdb.html"},"summary":"仅清理或分析 schema 中的所有表。可以通过多次指定 -n 来清理多个模式。"},{"signature":{"text":"-N schema --exclude-schema= schema","url":"/docs/18/app-vacuumdb.html"},"summary":"不清理或分析 schema 中的任何表。可以通过多次指定 -N 来排除多个模式。"},{"signature":{"text":"--no-index-cleanup","url":"/docs/18/app-vacuumdb.html"},"summary":"不删除指向死元组的索引条目。"},{"signature":{"text":"--no-process-main","url":"/docs/18/app-vacuumdb.html"},"summary":"跳过主关系。"},{"signature":{"text":"--no-process-toast","url":"/docs/18/app-vacuumdb.html"},"summary":"如果有，跳过与待清理表关联的 TOAST 表。"},{"signature":{"text":"--no-truncate","url":"/docs/18/app-vacuumdb.html"},"summary":"不截断表末尾的空页。"},{"signature":{"text":"-P parallel_workers --parallel= parallel_workers","url":"/docs/18/app-vacuumdb.html"},"summary":"指定 并行清理 的并行工作进程数量。这样可以让清理利用多个 CPU 处理索引。参见 VACUUM 。"},{"signature":{"text":"-q --quiet","url":"/docs/18/app-vacuumdb.html"},"summary":"不显示进度消息。"},{"signature":{"text":"--skip-locked","url":"/docs/18/app-vacuumdb.html"},"summary":"跳过那些无法立即加锁并进行处理的关系。"},{"signature":{"text":"-t table [ ( column [,...]) ] --table= table [ ( column [,...]) ]","url":"/docs/18/app-vacuumdb.html"},"summary":"仅清理或分析 table 。只有与 --analyze 或 --analyze-only 选项一起使用时，才能指定列名。可以通过多次指定 -t 来清理多个表。"},{"signature":{"text":"-v --verbose","url":"/docs/18/app-vacuumdb.html"},"summary":"在处理过程中输出详细信息。"},{"signature":{"text":"-V --version","url":"/docs/18/app-vacuumdb.html"},"summary":"输出 vacuumdb 的版本并退出。"},{"signature":{"text":"-z --analyze","url":"/docs/18/app-vacuumdb.html"},"summary":"同时计算供优化器使用的统计信息。"},{"signature":{"text":"-Z --analyze-only","url":"/docs/18/app-vacuumdb.html"},"summary":"仅计算供优化器使用的统计信息（不执行清理）。"},{"signature":{"text":"--analyze-in-stages","url":"/docs/18/app-vacuumdb.html"},"summary":"类似 --analyze-only ，仅计算供优化器使用的统计信息（不执行清理）。该选项会运行三个阶段的分析；第一阶段使用尽可能低的统计目标（见 default_statistics_target ），以便更快地生成可用统计信息，随后的阶段再构建完整统计信息。"},{"signature":{"text":"-? --help","url":"/docs/18/app-vacuumdb.html"},"summary":"显示 vacuumdb 命令行参数的帮助并退出。"},{"signature":{"text":"-h host --host= host","url":"/docs/18/app-vacuumdb.html"},"summary":"指定服务器所在机器的主机名。如果该值以斜杠开头，则它会被用作 Unix 域套接字目录。"},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-vacuumdb.html"},"summary":"指定服务器监听连接所用的 TCP 端口，或本地 Unix 域套接字文件扩展名。"},{"signature":{"text":"-U username --username= username","url":"/docs/18/app-vacuumdb.html"},"summary":"连接时使用的用户名。"},{"signature":{"text":"-w --no-password","url":"/docs/18/app-vacuumdb.html"},"summary":"绝不提示输入密码。如果服务器要求密码认证，而又无法通过其他方式获得密码，例如 .pgpass 文件，则连接尝试将失败。此选项可用于无人输入密码的批处理作业和脚本。"},{"signature":{"text":"-W --password","url":"/docs/18/app-vacuumdb.html"},"summary":"强制 vacuumdb 在连接数据库之前提示输入密码。"},{"signature":{"text":"--maintenance-db= dbname","url":"/docs/18/app-vacuumdb.html"},"summary":"当使用 -a / --all 时，连接到该数据库以收集要清理的数据库列表。如果未指定，则使用 postgres 数据库；若该数据库不存在，则使用 template1 。这可以是一个 连接字符串 。如果是这样，连接字符串参数将覆盖任何冲突的命令行选项。此外，除数据库名本身外，连接字符串中的其他参数在连接到其他数据库时也会被复用。"}],"title":"手册中的选项"},{"columns":[{"key":"name","label":"变量"},{"key":"description","label":"含义"}],"key":"environment","rows":[{"description":"默认连接参数","name":"PGDATABASE PGHOST PGPORT PGUSER"},{"description":"指定诊断消息是否使用颜色。可选值为 always 、 auto 和 never 。","name":"PG_COLOR"}],"title":"环境变量"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"47244faa0952abd5a844d611cebd1e39d0b47aa679c52838d2e3e37a22c5af35","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"command-description-and-options","fragment_sha256":"f9398ac4e1baa71dcc266c7c3d6088e3e44d30f3414513457f081c9e6f543855","locale":"zh-Hans","page_key":"app-vacuumdb.html","source_hash":"b48dea64816b13b2703c39ef0bdddf91372ac1e3445f1b561d6114904057268d","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/app-vacuumdb.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8"}},"ManualEvidence":{"manual_path":"app-vacuumdb.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-vacuumdb.html","label":"18.6 English manual · app-vacuumdb.html","sha256":"bf6a6504348c7e0f81a39c49654524dcfebfc8f0ff7340d492daf13c64f76eb9","url":"/docs/18/app-vacuumdb.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"vacuumdb","SourceDatabase":"center","Version":"18","Locale":"en","Title":"vacuumdb","Summary":"vacuumdb — garbage-collect and analyze a PostgreSQL database","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-VACUUMDB\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003evacuumdb\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003evacuumdb — garbage-collect and analyze a \u003cspan\u003ePostgreSQL\u003c/span\u003e database\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.23.4.1\"\u003e\u003ccode\u003evacuumdb\u003c/code\u003e [\u003cem\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode\u003e-t\u003c/code\u003e | \u003ccode\u003e--table\u003c/code\u003e \u003cem\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [( \u003cem\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...] )] ] ... [ \u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode\u003e-a\u003c/code\u003e | \u003ccode\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.23.4.2\"\u003e\u003ccode\u003evacuumdb\u003c/code\u003e [\u003cem\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode\u003e-n\u003c/code\u003e | \u003ccode\u003e--schema\u003c/code\u003e \u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e ] ... [ \u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode\u003e-a\u003c/code\u003e | \u003ccode\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.23.4.3\"\u003e\u003ccode\u003evacuumdb\u003c/code\u003e [\u003cem\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode\u003e-N\u003c/code\u003e | \u003ccode\u003e--exclude-schema\u003c/code\u003e \u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e ] ... [ \u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode\u003e-a\u003c/code\u003e | \u003ccode\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.23.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003evacuumdb\u003c/span\u003e is a utility for cleaning a \u003cspan\u003ePostgreSQL\u003c/span\u003e database. \u003cspan\u003evacuumdb\u003c/span\u003e will also generate internal statistics used by the \u003cspan\u003ePostgreSQL\u003c/span\u003e query optimizer.\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003evacuumdb\u003c/span\u003e is a wrapper around the SQL command \u003ca href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\" rel=\"nofollow\"\u003e\u003ccode\u003eVACUUM\u003c/code\u003e\u003c/a\u003e. There is no effective difference between vacuuming and analyzing databases via this utility and via other methods for accessing the server.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.23.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003evacuumdb\u003c/span\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-a\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--all\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eVacuum all databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--buffer-usage-limit \u003cem\u003e\u003ccode\u003esize\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the \u003ca href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" rel=\"nofollow\"\u003e\u003c/a\u003e\u003ca href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" title=\"Buffer Access Strategy\" rel=\"nofollow\"\u003eBuffer Access Strategy\u003c/a\u003e ring buffer size for a given invocation of \u003cspan\u003evacuumdb\u003c/span\u003e. This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See \u003ca href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\" rel=\"nofollow\"\u003e\u003cspan\u003eVACUUM\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e[\u003cspan\u003e-d\u003c/span\u003e] \u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e[\u003cspan\u003e--dbname=\u003c/span\u003e]\u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to be cleaned or analyzed, when \u003ccode\u003e-a\u003c/code\u003e/\u003ccode\u003e--all\u003c/code\u003e is not used. If this is not specified, the database name is read from the environment variable \u003ccode\u003ePGDATABASE\u003c/code\u003e. If that is not set, the user name specified for the connection is used. The \u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e can be a \u003ca href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" rel=\"nofollow\"\u003econnection string\u003c/a\u003e. If so, connection string parameters will override any conflicting command line options.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--disable-page-skipping\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisable skipping pages based on the contents of the visibility map.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho the commands that \u003cspan\u003evacuumdb\u003c/span\u003e generates and sends to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-f\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--full\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePerform \u003cspan\u003e“\u003cspan\u003efull\u003c/span\u003e”\u003c/span\u003e vacuuming.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-F\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--freeze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAggressively \u003cspan\u003e“\u003cspan\u003efreeze\u003c/span\u003e”\u003c/span\u003e tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--force-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAlways remove index entries pointing to dead tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-j \u003cem\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--jobs=\u003cem\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eExecute the vacuum or analyze commands in parallel by running \u003cem\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e commands simultaneously. This option may reduce the processing time but it also increases the load on the database server.\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003evacuumdb\u003c/span\u003e will open \u003cem\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e connections to the database, so make sure your \u003ca href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\" rel=\"nofollow\"\u003emax_connections\u003c/a\u003e setting is high enough to accommodate all connections.\u003c/p\u003e\n\u003cp\u003eNote that using this mode together with the \u003ccode\u003e-f\u003c/code\u003e (\u003ccode\u003eFULL\u003c/code\u003e) option might cause deadlock failures if certain system catalogs are processed in parallel.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--min-mxid-age \u003cem\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly execute the vacuum or analyze commands on tables with a multixact ID age of at least \u003cem\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e. This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see \u003ca href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND\" rel=\"nofollow\"\u003eSection 24.1.5.1\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFor the purposes of this option, the multixact ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by \u003cspan\u003evacuumdb\u003c/span\u003e will also process the TOAST table for the relation if necessary, it does not need to be considered separately.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--min-xid-age \u003cem\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly execute the vacuum or analyze commands on tables with a transaction ID age of at least \u003cem\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e. This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see \u003ca href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\" rel=\"nofollow\"\u003eSection 24.1.5\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFor the purposes of this option, the transaction ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by \u003cspan\u003evacuumdb\u003c/span\u003e will also process the TOAST table for the relation if necessary, it does not need to be considered separately.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--missing-stats-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with \u003ccode\u003e--analyze-in-stages\u003c/code\u003e, this option prevents \u003cspan\u003evacuumdb\u003c/span\u003e from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices.\u003c/p\u003e\n\u003cp\u003eThis option can only be used in conjunction with \u003ccode\u003e--analyze-only\u003c/code\u003e or \u003ccode\u003e--analyze-in-stages\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eNote that \u003ccode\u003e--missing-stats-only\u003c/code\u003e requires \u003ccode\u003eSELECT\u003c/code\u003e privileges on \u003ca href=\"/docs/18/catalog-pg-statistic.html\" rel=\"nofollow\"\u003e\u003ccode\u003epg_statistic\u003c/code\u003e\u003c/a\u003e and \u003ca href=\"/docs/18/catalog-pg-statistic-ext-data.html\" rel=\"nofollow\"\u003e\u003ccode\u003epg_statistic_ext_data\u003c/code\u003e\u003c/a\u003e, which are restricted to superusers by default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-n \u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--schema=\u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eClean or analyze all tables in \u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e only. Multiple schemas can be vacuumed by writing multiple \u003ccode\u003e-n\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-N \u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--exclude-schema=\u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not clean or analyze any tables in \u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e. Multiple schemas can be excluded by writing multiple \u003ccode\u003e-N\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not remove index entries pointing to dead tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-process-main\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip the main relation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-process-toast\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip the TOAST table associated with the table to vacuum, if any.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-truncate\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not truncate empty pages at the end of the table.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-P \u003cem\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--parallel=\u003cem\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify the number of parallel workers for \u003cem\u003eparallel vacuum\u003c/em\u003e. This allows the vacuum to leverage multiple CPUs to process indexes. See \u003ca href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\" rel=\"nofollow\"\u003e\u003cspan\u003eVACUUM\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-q\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--quiet\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not display progress messages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--skip-locked\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip relations that cannot be immediately locked for processing.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-t \u003cem\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--table=\u003cem\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eClean or analyze \u003cem\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e only. Column names can be specified only in conjunction with the \u003ccode\u003e--analyze\u003c/code\u003e or \u003ccode\u003e--analyze-only\u003c/code\u003e options. Multiple tables can be vacuumed by writing multiple \u003ccode\u003e-t\u003c/code\u003e switches.\u003c/p\u003e\n\u003cdiv\u003e\n\u003ch3\u003eTip\u003c/h3\u003e\n\u003cp\u003eIf you specify columns, you probably have to escape the parentheses from the shell. (See examples below.)\u003c/p\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint detailed information during processing.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan\u003evacuumdb\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-z\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--analyze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAlso calculate statistics for use by the optimizer.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-Z\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--analyze-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly calculate statistics for use by the optimizer (no vacuum).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--analyze-in-stages\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly calculate statistics for use by the optimizer (no vacuum), like \u003ccode\u003e--analyze-only\u003c/code\u003e. Run three stages of analyze; the first stage uses the lowest possible statistics target (see \u003ca href=\"/docs/18/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET\" rel=\"nofollow\"\u003edefault_statistics_target\u003c/a\u003e) to produce usable statistics faster, and subsequent stages build the full statistics.\u003c/p\u003e\n\u003cp\u003eThis option is only useful to analyze a database that currently has no statistics or has wholly incorrect ones, such as if it is newly populated from a restored dump or by \u003ccode\u003epg_upgrade\u003c/code\u003e. Be aware that running with this option in a database with existing statistics may cause the query optimizer choices to become transiently worse due to the low statistics targets of the early stages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003evacuumdb\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cspan\u003evacuumdb\u003c/span\u003e also accepts the following command-line arguments for connection parameters:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-h \u003cem\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--host=\u003cem\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-p \u003cem\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--port=\u003cem\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-U \u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--username=\u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan\u003evacuumdb\u003c/span\u003e to prompt for a password before connecting to a database.\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan\u003evacuumdb\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan\u003evacuumdb\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--maintenance-db=\u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen the \u003ccode\u003e-a\u003c/code\u003e/\u003ccode\u003e--all\u003c/code\u003e is used, connect to this database to gather the list of databases to vacuum. If not specified, the \u003ccode\u003epostgres\u003c/code\u003e database will be used, or if that does not exist, \u003ccode\u003etemplate1\u003c/code\u003e will be used. This can be a \u003ca href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" rel=\"nofollow\"\u003econnection string\u003c/a\u003e. If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.23.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGDATABASE\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode\u003ealways\u003c/code\u003e, \u003ccode\u003eauto\u003c/code\u003e and \u003ccode\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan\u003elibpq\u003c/span\u003e (see \u003ca href=\"/docs/18/libpq-envars.html\" rel=\"nofollow\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.23.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eIn case of difficulty, see \u003ca href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\" rel=\"nofollow\"\u003e\u003cspan\u003eVACUUM\u003c/span\u003e\u003c/a\u003e and \u003ca href=\"/docs/18/app-psql.html\" title=\"psql\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the \u003cspan\u003elibpq\u003c/span\u003e front-end library will apply.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.23.9\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo clean the database \u003ccode\u003etest\u003c/code\u003e:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003evacuumdb test\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean and analyze for the optimizer a database named \u003ccode\u003ebigdb\u003c/code\u003e:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003evacuumdb --analyze bigdb\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean a single table \u003ccode\u003efoo\u003c/code\u003e in a database named \u003ccode\u003exyzzy\u003c/code\u003e, and analyze a single column \u003ccode\u003ebar\u003c/code\u003e of the table for the optimizer:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003evacuumdb --analyze --verbose --table=\u0026#39;foo(bar)\u0026#39; xyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean all tables in the \u003ccode\u003efoo\u003c/code\u003e and \u003ccode\u003ebar\u003c/code\u003e schemas in a database named \u003ccode\u003exyzzy\u003c/code\u003e:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003evacuumdb --schema=\u0026#39;foo\u0026#39; --schema=\u0026#39;bar\u0026#39; xyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.23.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\" rel=\"nofollow\"\u003e\u003cspan\u003eVACUUM\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"7fb5f268ccbca3de33bfaf70126d48d5d756a86d96b282c76e17d7b4357b2bbb","Payload":{"description":["vacuumdb — garbage-collect and analyze a PostgreSQL database"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-VACUUMDB\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003evacuumdb — garbage-collect and analyze a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.23.4.1\"\u003e\u003ccode class=\"command\"\u003evacuumdb\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode class=\"option\"\u003e-t\u003c/code\u003e | \u003ccode class=\"option\"\u003e--table\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [( \u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...] )] ] ... [ \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode class=\"option\"\u003e-a\u003c/code\u003e | \u003ccode class=\"option\"\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.23.4.2\"\u003e\u003ccode class=\"command\"\u003evacuumdb\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode class=\"option\"\u003e-n\u003c/code\u003e | \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e ] ... [ \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode class=\"option\"\u003e-a\u003c/code\u003e | \u003ccode class=\"option\"\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.23.4.3\"\u003e\u003ccode class=\"command\"\u003evacuumdb\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [ \u003ccode class=\"option\"\u003e-N\u003c/code\u003e | \u003ccode class=\"option\"\u003e--exclude-schema\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e ] ... [ \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e | \u003ccode class=\"option\"\u003e-a\u003c/code\u003e | \u003ccode class=\"option\"\u003e--all\u003c/code\u003e ]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e is a utility for cleaning a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database. \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will also generate internal statistics used by the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e query optimizer.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e is a wrapper around the SQL command \u003ca class=\"link\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003ccode class=\"command\"\u003eVACUUM\u003c/code\u003e\u003c/a\u003e. There is no effective difference between vacuuming and analyzing databases via this utility and via other methods for accessing the server.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-a\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--all\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eVacuum all databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--buffer-usage-limit \u003cem class=\"replaceable\"\u003e\u003ccode\u003esize\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the \u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\"\u003e\u003c/a\u003e\u003ca class=\"glossterm\" href=\"/docs/18/glossary.html#GLOSSARY-BUFFER-ACCESS-STRATEGY\" title=\"Buffer Access Strategy\"\u003eBuffer Access Strategy\u003c/a\u003e ring buffer size for a given invocation of \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e. This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See \u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e[\u003cspan class=\"optional\"\u003e-d\u003c/span\u003e] \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e[\u003cspan class=\"optional\"\u003e--dbname=\u003c/span\u003e]\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to be cleaned or analyzed, when \u003ccode class=\"option\"\u003e-a\u003c/code\u003e/\u003ccode class=\"option\"\u003e--all\u003c/code\u003e is not used. If this is not specified, the database name is read from the environment variable \u003ccode class=\"envar\"\u003ePGDATABASE\u003c/code\u003e. If that is not set, the user name specified for the connection is used. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e can be a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e. If so, connection string parameters will override any conflicting command line options.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable-page-skipping\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisable skipping pages based on the contents of the visibility map.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho the commands that \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e generates and sends to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--full\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePerform \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003efull\u003c/span\u003e”\u003c/span\u003e vacuuming.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-F\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--freeze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAggressively \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003efreeze\u003c/span\u003e”\u003c/span\u003e tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--force-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAlways remove index entries pointing to dead tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--jobs=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eExecute the vacuum or analyze commands in parallel by running \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e commands simultaneously. This option may reduce the processing time but it also increases the load on the database server.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will open \u003cem class=\"replaceable\"\u003e\u003ccode\u003enjobs\u003c/code\u003e\u003c/em\u003e connections to the database, so make sure your \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e setting is high enough to accommodate all connections.\u003c/p\u003e\n\u003cp\u003eNote that using this mode together with the \u003ccode class=\"option\"\u003e-f\u003c/code\u003e (\u003ccode class=\"literal\"\u003eFULL\u003c/code\u003e) option might cause deadlock failures if certain system catalogs are processed in parallel.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--min-mxid-age \u003cem class=\"replaceable\"\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly execute the vacuum or analyze commands on tables with a multixact ID age of at least \u003cem class=\"replaceable\"\u003e\u003ccode\u003emxid_age\u003c/code\u003e\u003c/em\u003e. This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see \u003ca class=\"xref\" href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-MULTIXACT-WRAPAROUND\" title=\"24.1.5.1. Multixacts and Wraparound\"\u003eSection 24.1.5.1\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFor the purposes of this option, the multixact ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will also process the TOAST table for the relation if necessary, it does not need to be considered separately.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--min-xid-age \u003cem class=\"replaceable\"\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly execute the vacuum or analyze commands on tables with a transaction ID age of at least \u003cem class=\"replaceable\"\u003e\u003ccode\u003exid_age\u003c/code\u003e\u003c/em\u003e. This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see \u003ca class=\"xref\" href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND\" title=\"24.1.5. Preventing Transaction ID Wraparound Failures\"\u003eSection 24.1.5\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFor the purposes of this option, the transaction ID age of a relation is the greatest of the ages of the main relation and its associated TOAST table, if one exists. Since the commands issued by \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will also process the TOAST table for the relation if necessary, it does not need to be considered separately.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--missing-stats-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with \u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e, this option prevents \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices.\u003c/p\u003e\n\u003cp\u003eThis option can only be used in conjunction with \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e or \u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eNote that \u003ccode class=\"option\"\u003e--missing-stats-only\u003c/code\u003e requires \u003ccode class=\"literal\"\u003eSELECT\u003c/code\u003e privileges on \u003ca class=\"link\" href=\"/docs/18/catalog-pg-statistic.html\" title=\"52.51. pg_statistic\"\u003e\u003ccode class=\"structname\"\u003epg_statistic\u003c/code\u003e\u003c/a\u003e and \u003ca class=\"link\" href=\"/docs/18/catalog-pg-statistic-ext-data.html\" title=\"52.53. pg_statistic_ext_data\"\u003e\u003ccode class=\"structname\"\u003epg_statistic_ext_data\u003c/code\u003e\u003c/a\u003e, which are restricted to superusers by default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-n \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eClean or analyze all tables in \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e only. Multiple schemas can be vacuumed by writing multiple \u003ccode class=\"option\"\u003e-n\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not clean or analyze any tables in \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e. Multiple schemas can be excluded by writing multiple \u003ccode class=\"option\"\u003e-N\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-index-cleanup\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not remove index entries pointing to dead tuples.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-process-main\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip the main relation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-process-toast\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip the TOAST table associated with the table to vacuum, if any.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-truncate\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not truncate empty pages at the end of the table.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P \u003cem class=\"replaceable\"\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--parallel=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eparallel_workers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify the number of parallel workers for \u003cem class=\"firstterm\"\u003eparallel vacuum\u003c/em\u003e. This allows the vacuum to leverage multiple CPUs to process indexes. See \u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-q\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--quiet\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not display progress messages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--skip-locked\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSkip relations that cannot be immediately locked for processing.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--table=\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e [ (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e [,...]) ]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eClean or analyze \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e only. Column names can be specified only in conjunction with the \u003ccode class=\"option\"\u003e--analyze\u003c/code\u003e or \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e options. Multiple tables can be vacuumed by writing multiple \u003ccode class=\"option\"\u003e-t\u003c/code\u003e switches.\u003c/p\u003e\n\u003cdiv class=\"tip\"\u003e\n\u003ch3 class=\"title\"\u003eTip\u003c/h3\u003e\n\u003cp\u003eIf you specify columns, you probably have to escape the parentheses from the shell. (See examples below.)\u003c/p\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint detailed information during processing.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-z\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAlso calculate statistics for use by the optimizer.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-Z\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly calculate statistics for use by the optimizer (no vacuum).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--analyze-in-stages\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOnly calculate statistics for use by the optimizer (no vacuum), like \u003ccode class=\"option\"\u003e--analyze-only\u003c/code\u003e. Run three stages of analyze; the first stage uses the lowest possible statistics target (see \u003ca class=\"xref\" href=\"/docs/18/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET\"\u003edefault_statistics_target\u003c/a\u003e) to produce usable statistics faster, and subsequent stages build the full statistics.\u003c/p\u003e\n\u003cp\u003eThis option is only useful to analyze a database that currently has no statistics or has wholly incorrect ones, such as if it is newly populated from a restored dump or by \u003ccode class=\"command\"\u003epg_upgrade\u003c/code\u003e. Be aware that running with this option in a database with existing statistics may cause the query optimizer choices to become transiently worse due to the low statistics targets of the early stages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e also accepts the following command-line arguments for connection parameters:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--host=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--port=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--username=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e to prompt for a password before connecting to a database.\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003evacuumdb\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode class=\"option\"\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--maintenance-db=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen the \u003ccode class=\"option\"\u003e-a\u003c/code\u003e/\u003ccode class=\"option\"\u003e--all\u003c/code\u003e is used, connect to this database to gather the list of databases to vacuum. If not specified, the \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e database will be used, or if that does not exist, \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e will be used. This can be a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e. If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATABASE\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eIn case of difficulty, see \u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e and \u003ca class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e front-end library will apply.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.9\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo clean the database \u003ccode class=\"literal\"\u003etest\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb test\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean and analyze for the optimizer a database named \u003ccode class=\"literal\"\u003ebigdb\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb --analyze bigdb\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean a single table \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e in a database named \u003ccode class=\"literal\"\u003exyzzy\u003c/code\u003e, and analyze a single column \u003ccode class=\"literal\"\u003ebar\u003c/code\u003e of the table for the optimizer:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb --analyze --verbose --table='foo(bar)' xyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo clean all tables in the \u003ccode class=\"literal\"\u003efoo\u003c/code\u003e and \u003ccode class=\"literal\"\u003ebar\u003c/code\u003e schemas in a database named \u003ccode class=\"literal\"\u003exyzzy\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003evacuumdb --schema='foo' --schema='bar' xyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.23.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/sql-vacuum.html\" title=\"VACUUM\"\u003e\u003cspan class=\"refentrytitle\"\u003eVACUUM\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a --all","url":"/docs/18/app-vacuumdb.html"},"summary":"Vacuum all databases."},{"signature":{"text":"--buffer-usage-limit size","url":"/docs/18/app-vacuumdb.html"},"summary":"Specifies the Buffer Access Strategy ring buffer size for a given invocation of vacuumdb . This size is used to calculate the number of shared buffers which will be reused as part of this strategy. See VACUUM ."},{"signature":{"text":"--disable-page-skipping","url":"/docs/18/app-vacuumdb.html"},"summary":"Disable skipping pages based on the contents of the visibility map."},{"signature":{"text":"-e --echo","url":"/docs/18/app-vacuumdb.html"},"summary":"Echo the commands that vacuumdb generates and sends to the server."},{"signature":{"text":"-f --full","url":"/docs/18/app-vacuumdb.html"},"summary":"Perform “ full ” vacuuming."},{"signature":{"text":"-F --freeze","url":"/docs/18/app-vacuumdb.html"},"summary":"Aggressively “ freeze ” tuples."},{"signature":{"text":"--force-index-cleanup","url":"/docs/18/app-vacuumdb.html"},"summary":"Always remove index entries pointing to dead tuples."},{"signature":{"text":"-j njobs --jobs= njobs","url":"/docs/18/app-vacuumdb.html"},"summary":"Execute the vacuum or analyze commands in parallel by running njobs commands simultaneously. This option may reduce the processing time but it also increases the load on the database server."},{"signature":{"text":"--min-mxid-age mxid_age","url":"/docs/18/app-vacuumdb.html"},"summary":"Only execute the vacuum or analyze commands on tables with a multixact ID age of at least mxid_age . This setting is useful for prioritizing tables to process to prevent multixact ID wraparound (see Section 24.1.5.1 )."},{"signature":{"text":"--min-xid-age xid_age","url":"/docs/18/app-vacuumdb.html"},"summary":"Only execute the vacuum or analyze commands on tables with a transaction ID age of at least xid_age . This setting is useful for prioritizing tables to process to prevent transaction ID wraparound (see Section 24.1.5 )."},{"signature":{"text":"--missing-stats-only","url":"/docs/18/app-vacuumdb.html"},"summary":"Only analyze relations that are missing statistics for a column, index expression, or extended statistics object. When used with --analyze-in-stages , this option prevents vacuumdb from temporarily replacing existing statistics with ones generated with lower statistics targets, thus avoiding transiently worse query optimizer choices."},{"signature":{"text":"-n schema --schema= schema","url":"/docs/18/app-vacuumdb.html"},"summary":"Clean or analyze all tables in schema only. Multiple schemas can be vacuumed by writing multiple -n switches."},{"signature":{"text":"-N schema --exclude-schema= schema","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not clean or analyze any tables in schema . Multiple schemas can be excluded by writing multiple -N switches."},{"signature":{"text":"--no-index-cleanup","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not remove index entries pointing to dead tuples."},{"signature":{"text":"--no-process-main","url":"/docs/18/app-vacuumdb.html"},"summary":"Skip the main relation."},{"signature":{"text":"--no-process-toast","url":"/docs/18/app-vacuumdb.html"},"summary":"Skip the TOAST table associated with the table to vacuum, if any."},{"signature":{"text":"--no-truncate","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not truncate empty pages at the end of the table."},{"signature":{"text":"-P parallel_workers --parallel= parallel_workers","url":"/docs/18/app-vacuumdb.html"},"summary":"Specify the number of parallel workers for parallel vacuum . This allows the vacuum to leverage multiple CPUs to process indexes. See VACUUM ."},{"signature":{"text":"-q --quiet","url":"/docs/18/app-vacuumdb.html"},"summary":"Do not display progress messages."},{"signature":{"text":"--skip-locked","url":"/docs/18/app-vacuumdb.html"},"summary":"Skip relations that cannot be immediately locked for processing."},{"signature":{"text":"-t table [ ( column [,...]) ] --table= table [ ( column [,...]) ]","url":"/docs/18/app-vacuumdb.html"},"summary":"Clean or analyze table only. Column names can be specified only in conjunction with the --analyze or --analyze-only options. Multiple tables can be vacuumed by writing multiple -t switches."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-vacuumdb.html"},"summary":"Print detailed information during processing."},{"signature":{"text":"-V --version","url":"/docs/18/app-vacuumdb.html"},"summary":"Print the vacuumdb version and exit."},{"signature":{"text":"-z --analyze","url":"/docs/18/app-vacuumdb.html"},"summary":"Also calculate statistics for use by the optimizer."},{"signature":{"text":"-Z --analyze-only","url":"/docs/18/app-vacuumdb.html"},"summary":"Only calculate statistics for use by the optimizer (no vacuum)."},{"signature":{"text":"--analyze-in-stages","url":"/docs/18/app-vacuumdb.html"},"summary":"Only calculate statistics for use by the optimizer (no vacuum), like --analyze-only . Run three stages of analyze; the first stage uses the lowest possible statistics target (see default_statistics_target ) to produce usable statistics faster, and subsequent stages build the full statistics."},{"signature":{"text":"-? --help","url":"/docs/18/app-vacuumdb.html"},"summary":"Show help about vacuumdb command line arguments, and exit."},{"signature":{"text":"-h host --host= host","url":"/docs/18/app-vacuumdb.html"},"summary":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-vacuumdb.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"signature":{"text":"-U username --username= username","url":"/docs/18/app-vacuumdb.html"},"summary":"User name to connect as."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-vacuumdb.html"},"summary":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"signature":{"text":"-W --password","url":"/docs/18/app-vacuumdb.html"},"summary":"Force vacuumdb to prompt for a password before connecting to a database."},{"signature":{"text":"--maintenance-db= dbname","url":"/docs/18/app-vacuumdb.html"},"summary":"When the -a / --all is used, connect to this database to gather the list of databases to vacuum. If not specified, the postgres database will be used, or if that does not exist, template1 will be used. This can be a connection string . If so, connection string parameters will override any conflicting command line options. Also, connection string parameters other than the database name itself will be re-used when connecting to other databases."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default connection parameters","name":"PGDATABASE PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
