> For the complete documentation index, see [llms.txt](https://docs.percona.com/percona-monitoring-and-management/3/llms.txt).

# QAN Stored metrics: Details panel

The Details panel shows in-depth information about a selected query in the **Stored metrics** tab. Use it to analyze query execution time, view examples, and understand query plans.

Note

The Real-time tab has its own Details panel for viewing currently executing operations. See [Real-Time Query Analytics](https://docs.percona.com/percona-monitoring-and-management/3/use/qan/QAN-realtime-analytics.md).

Selecting an item under **QAN Stored metrics > Overview panel** opens the **Details panel** with a [Details tab](#details-tab).

If the dimension is **Query**, the panel also contains the [Examples Tab](#examples-tab), [Explain Tab](#explain-tab), and [Tables Tab](#tables-tab).

## Details Tab

The **Details** tab contains a **Query time distribution** bar (only for MySQL databases) and a set of **Metrics** in collapsible subpanels.

*Image: !image*

- The **Query time distribution** bar shows a query’s total time made up of colored segments, each segment representing the proportion of time spent on a named activity.

  - `query_time`: Statement execution time.
  - `lock_time`: Time to acquire locks.
  - `blk_read_time`: Total time the statement spent reading blocks (if `track_io_timing` is enabled, otherwise zero).
  - `blk_write_time`: Total time the statement spent writing blocks (if `track_io_timing` is enabled, otherwise zero).
  - `innodb_io_r_wait`: Time for InnoDB to read the data from storage.
  - `innodb_queue_wait`: Time the query spent either waiting to enter the InnoDB queue, or in it pending execution.
  - `innodb_rec_lock_wait`: Time the query waited for row locks.
  - `other`: Remaining uncategorized query time.

- **Metrics** is a table with headings:

  - **Metric**: The Metric name, with a question-mark tool-tip that reveals a description of the metric on mouse-over;
  - **Rate/Second**: A sparkline chart of real-time values per unit time;
  - **Sum**: A summation of the metric for the selected query, and the percentage of the total;
  - **Per Query Stats**: The value of the metric per query.

- Each row in the table is a metric. The contents depends on the chosen dimension.

For PostgreSQL queries (when using `pg_stat_monitor`) the top query will also be shown in the details section if the query was called by an outer query.

*Image: !image*

Other useful metrics (when using **pg_stat_monitor**) to monitor PostgreSQL Server performance are [Histograms](https://docs.percona.com/pg-stat-monitor/user_guide.html#histogram). **Histograms** provide more explicit information about number of queries for fingerprint (`queryid`). Ranges are from 0 seconds up to 100 seconds.

Here is picture of **histogram** in graph:

*Image: !image*

## Examples Tab

(For **Query** dimension.)

The **Examples** tab shows an example of the selected query’s fingerprint or table element.

*Image: !image*

Query example and fingerprint can be truncated to 1024 long to reduce space usage. In this case, the query explains section will not work.

## Explain Tab

(For **Query** dimension.)

The **Explain** tab shows the `explain` output for the selected query, in Classic or JSON formats.

- MySQL: Classic and JSON.
- MongoDB: JSON only.
- PostgreSQL: Not supported.

The **Explain** tab for MySQL queries works without enabling **Examples**. For security, sensitive data appears as placeholders that you must fill in before running Explain:

*Image: !image*

Below is an illustration of the same query using values instead of placeholders.

*Image: !image*

The image shown above illustrates a query with two placeholders. Therefore, you must enter the correct values in both fields. After filling in these values, click *Explain* to get the results like in the previous PMM versions without data leaks. You will get result like in previous PMM versions. This method of `explain` prevents data leak.

‘Explain’ for MongoDB

To run Explain you need the same permissions as for executing the original query. For example, to run explain on `updates` you need update permissions.

Example: Grant the `explainRole` with update permissions.

```text
db.grantPrivilegesToRole( "explainRole", [ { resource: { db: "", collection: "" }, actions: [ "update" ] } ])
```

*Image: !image*

## Tables Tab

(For **Query** dimension.)

The **Tables** tab shows information on the tables and indexes involved in the selected query.

*Image: !image*

## Plan Tab

(For **Query** dimension.)

The **Plan** tab shows the plan for PostgreSQL queries (only available when using *pg_stat_monitor*).

*Image: !image*
