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

Not all index scans are equal: How we cut query latency by over 99%

Blog post from Datadog

Post Details
Company
Date Published
Author
Nenad Noveljic, Bowen Chen
Word Count
969
Company Posts That Month
33
Language
English
Hacker News Points
8
Post removed?
No
Summary

Engineers at Datadog encountered an unexpectedly high-latency index scan in a PostgreSQL table, despite using an index scan that is typically efficient. The issue was traced to a mismatch between the column order of the composite index and the query's filtering predicates, which caused unnecessary disk I/O and high node costs. By creating a targeted index that matched the query's predicate order, engineers reduced the query latency from over 300 ms to 38 μs, demonstrating the importance of aligning index structures with query patterns. Datadog's Database Monitoring (DBM) tool now includes enhancements to automatically detect and suggest fixes for suboptimal index scans across databases, helping users identify and resolve inefficiencies without manual investigation.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Real-time 1 7,450 1,704 292 -47%
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.