Sample Exam Questions

From the objective of OSS-DB Exam Gold
- Monitoring Performance - Access statistics

Sample Question

1.03

Choose two correct statements regarding pg_class.

  1. The relpages column stores the number of rows in the table.

  2. pg_class stores only information about tables.

  3. The latest information is always stored in pg_class.

  4. The value in the relpages column is an estimate.

  5. Statistics stored in pg_class are updated by certain DDL commands.

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

Answer and Explanation

The correct answers are D and E.

pg_class is a system catalog containing various columns such as name, owner, and tablespace. The system catalog stores schema metadata and internal information, such as table and column definitions. This system catalog itself is also managed in PostgreSQL's table format. The reltuples and relpages columns within pg_class are specifically referenced by the planner when generating statistics.

Each option is explained below.

A. The relpages column stores the number of rows in the table.
Incorrect.
The relpages column stores the number of pages in the table.
The reltuples column stores the number of rows in the table.

B. pg_class stores only information about tables.
Incorrect.
pg_class stores not only information about tables, but also view and index information.

C. The latest information is always stored in pg_class.
Incorrect.
The statistics stored in pg_class are estimates and are updated by VACUUM, ANALYZE, and CREATE INDEX. Therefore, pg_class does not always contain the latest information.

D. The value in the relpages column is an estimate.
Correct.
The relpages and reltuples columns in pg_class contain estimates used by the planner.

E. Statistics stored in pg_class are updated by certain DDL commands.
Correct.
Such DDL commands include VACUUM, ANALYZE, and CREATE INDEX.