VOOZH about

URL: https://docs.datadoghq.com/database_monitoring/bits_database_optimization/

⇱ Bits Database Optimization


Bits Database Optimization

Bits Database Optimization is only available for PostgreSQL. To request support for another database management system, contact your Datadog representative or Datadog Support.

Overview

Bits Database Optimization detects underperforming queries across your database fleet, identifies optimizations validated against a simulated copy of your environment, and delivers the result as a pull request fixing the exact code that triggered the query.

Optimization candidates are selected automatically from Database Monitoring telemetry, with no additional setup required. Candidates are identified by highest potential impact, focusing on query execution times, blocking queries, and regressed queries.

Bits Database Optimization does not require write access to your database, and does not export or use actual data from your environment. Optimizations are empirically tested against database simulations populated with synthetic data using statistical properties of your schema.

Prerequisites

  • Database Monitoring is configured for the target database instances. See Database Monitoring Setup.
  • Schema collection is enabled on the target instances.
  • For automated PR creation:
    • APM must be configured for the services that issue the queries you want to address. See Correlate Database Monitoring and Traces for more information.
    • A GitHub repository must be linked in your Datadog organization.

Viewing optimizations

Query list

On the Database Monitoring > Queries screen, queries with optimizations available have an AI icon in the Status column. Hover over an icon to see a summary of the optimization, and click the icon to open the Optimization panel.

To filter the query list by optimization type, select an option from Optimizations above the list.

Optimization panel

The Optimization panel includes a summary of the query issue, the optimized query used in the simulation, and a visualization of the Simulated Performance Impact.

Explore the Simulated Performance Impact visualization for more details about improvements:

  • Hover over the improvement summary (for example, “96.9x faster”) to view before-and-after execution times, logical reads, and shared blocks dirtied. The table shows the average, median, P95, and maximum for each metric.
  • Hover over each item in the visualization to view more details.

Click Compare Plans to view side-by-side comparisons of the current and optimized execution plans:

  • List View shows a hierarchical list of the execution plan’s operations, with node cost and row estimates for each step.
  • Map View shows a visual representation of the execution plan, with the option to compare the plans by different metrics.
  • Raw shows the raw execution plan output.

Review the pull request

To review the PR for the optimization fix to your database, select Review PR by Bits AI. The GitHub PR opens with a pre-populated description that includes the simulation results.

Automated pull requests require APM to be configured for the service issuing the query, and a GitHub repository linked to your Datadog organization.

Further reading