Skip to contents

Performs a VACUUM (garbage-collect and optionally analyze) on a table.

Usage

dbVacuum(
  conn,
  name,
  full = FALSE,
  verbose = FALSE,
  analyze = TRUE,
  display = TRUE,
  exec = TRUE
)

Arguments

conn

A connection object.

name

A character string specifying a PostgreSQL table name.

full

Logical. Whether to perform a "full" vacuum, which can reclaim more space, but takes much longer and exclusively locks the table.

verbose

Logical. Whether to print a detailed vacuum activity report for each table.

analyze

Logical. Whether to update statistics used by the planner to determine the most efficient way to execute a query (default to TRUE).

display

Logical. Whether to display the query (defaults to TRUE).

exec

Logical. Whether to execute the query (defaults to TRUE).

Value

If exec = TRUE, returns TRUE if query is successfully executed.

See also

Author

Mathieu Basille mathieu@basille.org

Examples

## examples use a dummy connection from DBI package
conn <- DBI::ANSI()
dbVacuum(conn, name = c("schema", "table"), full = TRUE, exec = FALSE)
#> Query not executed:
#> VACUUM FULL ANALYZE "schema"."table";