Dynatrace
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.
A statement in
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 = ?;
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.
The Statement performance analysis view in
Databases lets you explore collected statements and focus on the queries that matter most.
You can:
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.
When you select Request execution plan for a statement in
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.
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.
Databases