Try it free

Database statements and execution plans in Dynatrace

  • Latest Dynatrace
  • Explanation
  • Published Aug 26, 2026

Overview

Dynatrace Databases Databases collects SQL statements from monitored database instances and surfaces them in the Statement performance analysis view. You can use this data to identify resource-intensive queries, understand query behavior over time, and request execution plans to diagnose performance issues.

Statements

A statement in Databases Databases represents a normalized SQL query collected from a monitored database instance. Normalization replaces literal parameter values with placeholders, so two queries that differ only in their values are treated as the same statement. This makes it possible to aggregate performance data across executions and identify patterns without exposing sensitive data.

Before normalization:

SELECT * FROM orders WHERE customer_id = 1042;
SELECT * FROM orders WHERE customer_id = 9871;

After normalization:

SELECT * FROM orders WHERE customer_id = ?;

How statements are collected

Database extensions collect the statements per database instance, ranked by resource consumption and execution time. Statements are sampled at a configurable interval. Because sampling occurs periodically, the ranked list may vary between samples, but consistently expensive statements appear reliably over time.

Statement data is stored in the default_database_monitoring Grail bucket and retained for 35 days by default. For details on collection limits and retention, see Data collected with Dynatrace database monitoring.

Statement performance analysis

The Statement performance analysis view in Databases Databases lets you explore collected statements and focus on the queries that matter most.

You can:

  • Use Filter statements to search for a specific query or keyword.
  • Set Contextual analysis to rank and compare statements by Time, CPU, Disk, or Waits.
  • Customize columns using the column settings to adapt the view to your analysis needs.
  • Select Request execution plan on any statement to fetch its execution plan directly from the database.

Execution plans

An execution plan describes the steps the database engine takes to run a statement. It shows which indexes, joins, scans, and other operations the engine uses, and the order in which it performs them.

Reviewing the execution plan for a slow or resource-intensive statement helps you understand why the query is expensive and what changes (such as adding an index or rewriting a join) might improve performance.

How execution plans work in Dynatrace

When you select Request execution plan for a statement in Databases Databases, Dynatrace sends the statement to the database and retrieves the plan in real time. The result is stored as a log record in the default_database_monitoring bucket with event.group = "execution_plans".

Execution plan data is sanitized before storage. Parameter values are stripped to prevent exposure of sensitive information.

Data privacy and PII

All statement data collected by Dynatrace is normalized before storage to remove Personally Identifiable Information (PII). Literal values, such as names, email addresses, or IDs, are replaced with placeholders (?). Execution plans are sanitized in the same way, with parameter values stripped before the plan is stored.

This normalization also has a performance benefit; it groups queries that share the same structure, making it easier to identify patterns and aggregate metrics across executions.

For more information on how data is collected and retained, see Data collected with Dynatrace database monitoring.

Use cases

  • Identify expensive SQL statements and track their behavior over time.
  • Compare top query performance across monitored database instances.
  • Retrieve and review execution plans to diagnose slow query performance.

Related topics

  • Data collected with Dynatrace database monitoring
  • Database health score overview
  • Database monitoring approaches
Related tags
Infrastructure ObservabilityDatabasesDatabases