Title: Monitoring database performance with VIP APM
Author: liranadia
Published: October 20, 2026

---

 1. [Performance](https://docs.wpvip.com/performance/)
 2. [VIP Application Performance Monitoring](https://docs.wpvip.com/performance/vip-application-performance-monitoring/)
 3. Monitoring database performance with VIP APM

#  Monitoring database performance with VIP APM

The **Databases** view in [VIP Application Performance Monitoring](https://docs.wpvip.com/performance/vip-application-performance-monitoring/)(
VIP APM) provides query volume and timing for the database operations recorded in
an environment’s sampled traces. It ranks operations by the time they consume, shows
how each one performs over time, and links every recorded query to the full transaction
trace that ran it.

## Prerequisites

To use the Databases view, VIP APM must be enabled for the environment, and the 
user must open the diagnostic interface from the VIP Dashboard. See [VIP Application Performance Monitoring](https://docs.wpvip.com/performance/vip-application-performance-monitoring/)
for the steps.

## Limitations

 * Metrics are based on sampled traces. They represent recorded queries, not every
   query run on the environment.
 * Metrics include only queries recorded after database collection began for the
   environment. Earlier activity is not backfilled.
 * The Databases view covers the last 7 days, back to midnight UTC six days ago.
   A range that starts earlier is shortened to that date.
 * Literal values in SQL statements are replaced with ? before they are stored, 
   and lists of values in IN (…) become a single ?. Queries that differ only by 
   their values are grouped into one operation. SQL comments are removed, and very
   long statements are shortened.

## Opening the Databases view

 1. Open the diagnostic interface by selecting **View in VIP APM** in the VIP Dashboard.
 2. Select **Databases** in the top navigation.
 3. Select a time range.
 4. Optionally, select a **SQL operation** (SELECT, INSERT, UPDATE, or DELETE) to limit
    the view to one statement type.

## Reviewing the summary

| **Metric** | **What it shows** | 
| Avg query time | Mean recorded query duration. | 
| Throughput | Recorded queries per minute. | 
| Slow queries (>200 ms) | Number of recorded queries that took longer than 200 ms. | 
| Distinct operations | Number of distinct database operations within the selected range. |

## Investigating a database operation

 1. Review **Top Database Operations**, which ranks the top five operations by recorded
    query time and shows each operation’s share.
 2. Select an operation to preview its average query time, P95 query time, slowest 
    query, and number of calls, with **Query time** and **Throughput** charts over 
    the selected range.
 3. Select **View Full Query** to see the complete statement.
 4. Select **View Operation Details** to open the operation’s page.
 5. Review **Related Transactions** , which groups the operation’s recorded runs by
    transaction. Each row shows the number of runs, the number of traces, the average
    queries per trace, the total query time, and the slowest run.
 6. Expand a transaction to see each run with its time, path, query duration, transaction
    duration, and code owner. Select **View trace span** to open the full transaction
    trace at that query, or View slowest trace to open the trace with the slowest run..

\

A high Avg queries per trace, or a max much higher than the average, can mean the
same query runs in a loop. The Owner column shows which plugin, must-use plugin,
or theme ran it.

## Finding slow queries

The tables below the charts summarize recorded queries.

 * **Slow queries** lists one row per query, with its number of slow runs, number
   of traces, total query time, and slowest run. Expand a query to see each slow
   run and open its trace.
 * **All operations** list every recorded database operation in the selected range,
   with calls, throughput, and average, P95, and maximum query time.

Use **Minimum Duration** (any duration, or ≥ 50 ms, 100 ms, 200 ms, 500 ms, or 1
s)to filter the runs shown in Slow queries and Related Transactions. Slow queries
starts at ≥ 200 ms.The filter applies to the table only; the summary totals and 
rankings do not change.

To reduce the cost of slow queries once they are identified, review the guidance
to [identify slow queries](https://docs.wpvip.com/databases/optimize-queries/identify-slow-queries/)
and [optimize queries](https://docs.wpvip.com/databases/optimize-queries/).

## Troubleshooting

### The Databases view shows no data

Database metrics include only queries recorded after collection began. Select a 
more recent time range, or confirm that VIP APM is enabled for the environment.

### Total query time is higher than the transaction duration

Total query time adds up the operation’s recorded runs across every trace in the
selected range. In Slow queries, it includes only runs that meet Minimum Duration.
To compare a single run with its transaction, expand the row and compare **Query
duration** with **Transaction duration**.

Last updated: October 20, 2026