---
title: "Automatically optimize database queries with Datadog Database Monitoring"
url: https://daily.dev/posts/automatically-optimize-database-queries-with-datadog-database-monitoring-zigejizsa
source_url: https://www.datadoghq.com/blog/bits-database-optimization
type: article
source: "Datadog"
published: 2026-06-10T11:57:56.611Z
updated: 2026-06-10T11:58:21.105Z
tags: ["devops", "postgresql"]
reading_time: 6
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Automatically optimize database queries with Datadog Database Monitoring

**[Datadog](https://daily.dev/sources/datadog)** · 6 min read · 0 upvotes · 0 comments

## Summary

Datadog's Bits Database Optimization automates the full query optimization lifecycle within Database Monitoring (DBM). It scans your database fleet, ranks slow queries by total execution time, generates concrete rewrites or index recommendations, and validates them against a simulated copy of your schema using synthetic data that mirrors production statistics. Only proven improvements are surfaced. Once validated, Bits AI traces the query back to its source code via APM spans, locates the exact file and line, and opens a GitHub pull request with the diff and simulation evidence embedded. After merging, teams can verify real-traffic improvements directly in DBM Query Metrics. No write access to production databases is required, and no customer data leaves your environment.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.datadoghq.com/blog/bits-database-optimization>

## Similar posts on daily.dev

- [Turn Datadog findings into automated code fixes with Bits Code](https://daily.dev/posts/turn-datadog-findings-into-automated-code-fixes-with-bits-code-xhqssnjkw) · Datadog · 0 upvotes · 0 comments
- [Get reliable answers to business questions with Bits Data Analysis](https://daily.dev/posts/get-reliable-answers-to-business-questions-with-bits-data-analysis-rctkcp33x) · Datadog · 1 upvotes · 0 comments
- [Optimize Spark and Databricks jobs with Datadog](https://daily.dev/posts/optimize-spark-and-databricks-jobs-with-datadog-gp3lblhkw) · Datadog · 0 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/automatically-optimize-database-queries-with-datadog-database-monitoring-zigejizsa)
