VACUUM mytable;
VACUUM FULL mytable;
VACUUM VERBOSE mytable;
VACUUM FULL;
VACUUM -f mytable;
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2025/05/29
The correct answer is "B. VACUUM FULL mytable;".
postgresql allows recovery of unneeded space in the database.
With the FULL option, postgresql will truncate updated/deleted rows.
However, when the FULL option is specified, postgresql may take a long time to process or may exclusively lock all the tables it acts on.
Therefore, use this option when you urgently need to free up disk space.
Each option is explained below.
A. VACUUM mytable;.
Incorrect.
Without any options, postgresql retains the updated/deleted rows.
B. VACUUM FULL mytable;.
Correct.
C. VACUUM VERBOSE mytable;.
With the VERBOSE option, postgresql outputs detailed information about the VACUUM process.
D. VACUUM FULL;
Incorrect.
When the FULL option is specified, postgresql will truncate the updated/deleted rows, but if you do not specify the table name, all tables will be included.
In this case, we want to truncate updated/deleted rows for the "mytable" table only, so we need to specify the table name.
E. VACUUM -f mytable;.
Incorrect.
The -f option does not exist.