Performs a VACUUM (garbage-collect and optionally analyze) on a table.
dbVacuum( conn, name, full = FALSE, verbose = FALSE, analyze = TRUE, display = TRUE, exec = TRUE )
TRUE if query is successfully executed.
A connection object.
A character string specifying a PostgreSQL table name.
Logical. Whether to perform a "full" vacuum, which can reclaim more space, but takes much longer and exclusively locks the table.
Logical. Whether to print a detailed vacuum activity report for each table.
Logical. Whether to update statistics used by the planner to determine the most efficient way to execute a query (default to TRUE).
TRUE
Logical. Whether to display the query (defaults to TRUE).
Logical. Whether to execute the query (defaults to TRUE).
Mathieu Basille basille@ufl.edu
The PostgreSQL documentation: http://www.postgresql.org/docs/current/static/sql-vacuum.html
## examples use a dummy connection from DBI package conn<-DBI::ANSI() dbVacuum(conn, name = c("schema", "table"), full = TRUE, exec = FALSE)
Run the code above in your browser using DataCamp Workspace