Sample Exam Questions

From the objective of OSS-DB Exam Gold
- Advanced Server Administration - Commands for database administration

Sample Question

1.02

"I want to truncate updated/deleted rows for the ""mytable"" table only.
Which of the following is the correct use of the VACUUM command?"

  1. VACUUM mytable;

  2. VACUUM FULL mytable;

  3. VACUUM VERBOSE mytable;

  4. VACUUM FULL;

  5. VACUUM -f mytable;

※This sample exam is different from those that appear in the actual OSS-DB Exam.
2025/05/29

Answer and Explanation

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.