Sample Exam Questions

From the objective of OSS-DB Exam Gold
- Monitoring Performance - Statistics for tables and columns

Sample Question

1.10

Choose two correct statements regarding table/column statistics.

  1. pg_class handles information on views and indexes as well as tables.

  2. pg_class always contains the latest information.

  3. "reltuples", a column in pg_class, stores the estimated number of rows in the table.

  4. pg_stats is a table that displays column statistics.

  5. Because some of the information accessible through pg_stats includes actual data, it cannot be accessed by regular users.

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

Answer and Explanation

Among table/column statistics, this question is related to pg_class and pg_stats.

The system catalog, which stores schema metadata and internal information (such as table and column definitions), is itself managed as a set of PostgreSQL tables.

pg_class is a system catalog that stores information about tables, views, indexes, and other database objects. It stores static information (such as name, owner, and tablespace) and statistics (such as the estimated number of rows, reltuples). These statistics are estimates used by the planner and are updated by VACUUM and ANALYZE. Therefore, it does not necessarily contain the latest information.
Considering the above in relation to options A through C, A and C are correct, and B is incorrect.

pg_stats is a view that provides access to information stored in pg_statistic, which is a system catalog.
pg_statistic stores statistical information about table columns. For example, it stores information about the distribution of values within a column, which the query planner uses to optimize queries. Because pg_statistic stores detailed information about data distribution, allowing unrestricted access would pose a security risk. Therefore, pg_statistic cannot be referenced by general users.
Instead, a restricted view called pg_stats is provided, which exposes a subset of the information in pg_statistic suitable for general user access.
Considering the above in relation to options D and E, both D and E are incorrect.


The correct answers are A and C.