Postgresql easy
In the context of PostgreSQL storage management, what is the primary objective of the `VACUUM` command?
- A To immediately delete the database and free up logical partitions for other users.
- B To reclaim disk space by removing dead row versions created by UPDATE/DELETE.
- C To encrypt the underlying database files using a rotating system-level master key.
- D To convert the standard heap storage into a more efficient columnar format.
Answer: B. To reclaim disk space by removing dead row versions created by UPDATE/DELETE.
Because of MVCC, rows are not deleted in-place; they are marked as 'dead'. `VACUUM` identifies these dead rows (tuples) so the space can be reused by the database, preventing excessive disk bloat over time.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a PostgreSQL environment, what functional characteristic distinguishes a `MATERIALIZED VIEW` from a standard `VIEW`?
- Which standard PostgreSQL utility is designed to extract a single database into a script or archive file for backup purposes?
- Why would PostgreSQL reject a `DELETE` operation on a record despite the user having full administrative privileges?
- The 'Heap Only Tuples' (HOT) optimization improves UPDATE performance. Which specific set of conditions must be met for a HOT update to occur?
- Which native command-line utility is used to execute SQL queries and manage PostgreSQL databases from a terminal session?
- What is the specific purpose of 'Freezing' a row (modifying its `xmin` status) during a major VACUUM operation?