CompTIA DataSys+ (DS0-002) Practice Questions

CompTIA DataSys+ (DS0-002 V2) exam preparation

CompTIA DataSys+ (DS0-002) practice questions in English: 180 questions with explanations. The mock exam has 90 questions and 90 minutes.

CompTIA DataSys+ (DS0-002) free question 5 / 10 · Domain 3: Database Management and Maintenance

A DBA wants to rank the statements that used the most total execution time over the last week. Which column of the pg_stat_statements view holds that value?

  1. The column holding the number of times the statement ran
  2. The column holding the total time spent executing the statement
  3. The column holding the minimum time spent executing the statement
  4. The column holding the maximum time spent executing the statement
Show the answer and explanation

Answer: B

Why this is correct
The pg_stat_statements view documents total_exec_time as the total time spent executing the statement, in milliseconds, next to calls, the number of times it was executed, and minimum and maximum times. Ranking by the total shows which statements cost the server most overall. The source reads: "Total time spent executing the statement, in milliseconds" Source page: F.30. pg_stat_statements — track statistics of SQL planning and execution, section "F.30.1. The pg_stat_statements View".

Why the other options are wrong
"The column holding the number of times the statement ran" … calls counts executions. A cheap statement run very often has a high count but may use little total time.
"The column holding the minimum time spent executing the statement" … The minimum shows the best single execution, which hides how much time a statement used overall.
"The column holding the maximum time spent executing the statement" … The maximum shows the worst single execution, not the total time used by the statement.

Key points
Rank by total_exec_time to find the statements that use the most server time.

Go to the CompTIA DataSys+ (DS0-002) practice app (10 free questions; purchase unlocks all questions)

See the full practice set