Database Monitoring Fundamentals Certification / 03 / 05

Metrics, Performance, and Query Analysis

What this domain covers

This domain covers how to read database performance with DBM data. There are four pillars. First, Query Metrics: how the top 200 are selected, what the columns mean, facets and grouping, and filtering by query_signature. Second, Query Samples: how to read them as point-in-time snapshots, the duration and index facets, and visualizations. Third, explain plans: per-node estimates, unitless cost, and how to compare the multiple plans of a single query. Fourth, the impact on applications: skew across hosts, the database as seen from APM views, and the connection breakdown. The exam asks questions such as "Which value in which view do you use for this question?" Figures are based on the official documentation as of October 2026.

Topics listed in the official guide

  • Identify database performance issues
  • Use Query Metrics and Query Samples appropriately
  • Interpret normalized queries and explain plans
  • Analyze resource utilization and workload trends
  • Evaluate database impact on application performance

Key points

  • The Query Metrics list shows the top 200 normalized queries by total execution time in the selected time range.
  • The default columns include Requests, Average latency, Total time, and Percent time. Percent time is the share of database time.
  • You can group by up to three items (for example, host, env, and datacenter).
  • To narrow down to a single long query, use query_signature rather than the query tag, which is truncated at 200 characters.
  • Even with high average latency, a query that runs rarely may have little overall impact. Compare by share of database time.
  • Grouping by host from Filter by This Query and sorting by Percent time or Rows/Query reveals skew across hosts and unbalanced sharding.
  • Query Samples are point-in-time snapshots; they do not represent every query, but they give a rough sense of proportions.
  • Explain plan cost is a unitless relative measure used to compare plans. Investigate the reasons for large differences rather than small ones.
  • BEGIN, COMMIT, SHOW, USE, ALTER, and similar queries cannot produce explain plans. Plans cover SELECT, UPDATE, INSERT, DELETE, and REPLACE.
  • In the Databases section of the APM service page, you can check the downstream database hosts identified by DBM and the queries that are latency outliers.

Terms and concepts

How the Query Metrics list is built

The Query Metrics view lists the 200 normalized queries with the most total execution time in the selected time range. The ordering criterion is total time, not average latency or error count, so aggregates for fast queries that run only rarely may not appear. Snapshots of such queries still remain in Query Samples if they ran within the past 15 days.

Facets, grouping, and query_signature

The facets on the left are divided into Core (service, host, environment), Database, and Infrastructure, and in the Database section Postgres has database and user facets while MySQL has a schema facet. Grouping can use up to three items. To narrow down to a single normalized query, use query_signature, because the query tag is truncated at 200 characters and may not be unique for long queries.

Reading Percent time versus average latency

Requests is the execution count, Average latency is the average per execution, Total time is the total, and Percent time is the share of all database time. The query detail graphs show the query alongside all other queries. Even with high average latency, a query that runs rarely may have little overall impact, so decide which queries to fix first by comparing shares.

Looking at skew across hosts

In the query details, click Filter by This Query, group by host, and sort by Percent time to see whether a particular host accounts for most of the query's execution. Sorting by Rows/Query shows whether a particular host tends to return many rows, which is a clue to unbalanced sharding. From the Hosts Running This Query tab, you can move to the host's logs and network data.

How to read Query Samples

The Samples view shows point-in-time snapshots of running and recently finished queries. Because they are snapshots, they are not necessarily representative of every query, but they can indicate proportions. Sampling is biased toward slow and frequent queries, so a query that was slow only briefly may appear in samples yet have no aggregate row in Query Metrics. If it is not a top query, the graphs in the sample details are empty too.

Query Samples visualizations and facets

Besides the list, samples can be shown as a timeseries, top list, or table. A query that is usually fast but occasionally slow shows up as an outlier when you graph the p90 or p99 duration. Choosing a long period of about a week and looking at the lowest counts in the index facet reveals candidate indexes that are rarely used.

Explain plan nodes and cost

An explain plan shows startup cost, total cost, plan rows, and plan width for each node (step). Cost is a unitless measure, neither milliseconds nor bytes, used to compare plans with each other. Rather than small differences such as 8.5 versus 8.7, it is worth investigating when two queries that should be similar differ greatly in cost. COMMIT, SHOW, and similar statements are types that cannot produce plans.

Multiple plans for one query

DBM collects explain plans continuously, so multiple plans can accumulate for a single normalized query. Plans are normalized and shown separately, letting you tell well-performing plans from plans with a higher relative cost. Even if the query text does not change, performance changes when the plan the database chooses changes, so compare which plan was used during the slow period.

The database as seen from the application

When APM and DBM are correlated, the Databases section of the APM service page lets you view the immediate downstream database hosts identified by DBM to judge skew in load, and the Queries tab shows latency outliers and a list of queries. On the DBM side, you can break down a host's active connections by calling APM service. Database-side values that APM does not capture, such as row counts, are viewed in Query Metrics.

Connection and wait event metrics

The Postgres integration collects the number of active connections broken down by process attributes as a DBM-only metric, tagged with state, application, user, and db. The MySQL integration collects the average wait time and count per wait event as DBM-only metrics, tagged with wait_event. These are standard metrics, so you can track trends by time of day on dashboards.

Check your understanding

Check what you have learned with 5 questions