Sample Exam Questions

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

Sample Question

2.01

Choose the two statements that most appropriately
explain access statistics (operating statistics view),
such as pg_stat_database and pg_stat_all_tables.

  1. Data is collected when the ANALYZE command is run.
  2. Data is collected periodically using the stats collector process.
  3. The status of data within the table, such as number of rows, maximum value, minimum value, and the distribution of data in the table, is collected.
  4. Access statistics are used by the planner to create an optimized SQL execution plan.

  5. Access statistics are used to investigate the total system throughput and detect performance issues.

※This sample exam is different from those that appear in the actual OSS-DB Exam.
2011/12/27

Answer and Explanation

There are a wide variety of mechanisms to collect statistics from the database.
Statistics are used to maintain and improve performance and detect performance issues; however, collection methods often differ according to the type of statistics.
By default, access statistics (operating statistics) are collected by the stats collector process every 500 milliseconds and are referenced via the statistics view, etc.
For example, the pg_stat_database includes information such as the number of committed transactions, rollbacks, and selected, inserted, updated, and deleted rows. This can be used to investigate the system’s overall operating state and to detect issues in the system.
Information used by the planner to create an optimized SQL execution plan is also referred to as statistics; however, this information is different from access statistics. Specifically, static information, such as number of rows, maximum value, minimum value, and data distribution in the table are collected when the ANALYZE command is executed. This type of static information is stored in system catalogs, such as pg_class and pg_statistic.

Therefore, the correct answers are B and E.