Sample Exam Questions

From the objective of OSS-DB Exam Gold
- Monitoring Performance - Other performance monitoring

Sample Question

1.02

Which of the following statements is a correct description of pg_stat_statements?

  1. It records execution time spent for SQL statements that exceed a specified threshold.

  2. It identifies transactions and target tables currently waiting for locks.

  3. It records execution statistics for all executed SQL statements.

  4. It displays overall database statistics, with one row per database.

  5. It displays table access statistics, with one row per table in the current database.

※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 "C. It records execution statistics for all executed SQL statements."

pg_stat_statements is a module that records execution statistics for all executed SQL statements. It can be used to analyze slow queries by checking the number of executions and the cumulative processing time of SQL statements.

Each option is explained below.

A. It records execution time spent for SQL statements that exceed a specified threshold.
Incorrect.
The above is an explanation of log_min_duration_statement.

B. It identifies transactions and target tables currently waiting for locks.
Incorrect.
The above is an explanation of pg_locks.

C. It records execution statistics for all executed SQL statements.
Correct.

D. It displays overall database statistics, with one row per database.
Incorrect.
The above is an explanation of pg_stat_database.

E. It displays table access statistics, with one row per table in the current database.
Incorrect.
The above is an explanation of pg_stat_all_tables.