Home / Companies / Datadog / Blog / Post Details
Content Deep Dive

How Bits Database Optimization proves a query rewrite is faster

Blog post from Datadog

Post Details
Company
Date Published
Author
Alex Weisberger, Nenad Noveljić, Bowen Chen
Word Count
1,684
Company Posts That Month
26
Language
English
Hacker News Points
-
Post removed?
No
Summary

Datadog Bits Database Optimization aims to validate query rewrites before recommending them by benchmarking original and revised queries in disposable database instances that recreate production schemas, indexes, constraints, and key data characteristics through synthetic data based on collected table and column statistics. This controlled approach avoids production security and workload risks while reducing variability from cache states, locks, and resource contention; cache warm-up is performed within rolled-back transactions to preserve database state. Datadog evaluates simulation accuracy through cost fidelity, which compares query planner estimates, and read fidelity, which compares data blocks accessed, reporting substantially closer results than randomly generated data across many query types while continuing work on weaker cases such as correlated multi-column AND conditions. Bits judges proposed optimizations using server-reported execution time, logical reads, and dirtied blocks over 50 repeated runs, requiring improvements greater than 20 percent in at least three of four statistics—average, median, p95, and maximum—to ensure gains are meaningful and consistent. Currently available for Postgres, the feature identifies and tests query rewrites and index changes, withholding recommendations that do not meet its performance criteria, with support for MySQL, Microsoft SQL Server, and Oracle planned.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.