Home / Companies / Tiger Data / Blog / Post Details
Content Deep Dive

Knowing When Your Composite Index Earns Its Write Cost

Blog post from Tiger Data

Post Details
Company
Date Published
Author
NanoHertz Communications
Word Count
1,849
Company Posts That Month
7
Language
English
Hacker News Points
-
Post removed?
No
Summary

Indexes should be treated as measurable trade-offs rather than defaults because they can greatly accelerate compatible queries while adding persistent write, storage, WAL, and page-split costs to every insert. Using a PostgreSQL composite index on `(tag_id, ts DESC)` as an example, the guide explains that such indexes work best when queries filter on the leading column, enabling efficient seeks and ordered results, but may provide little benefit for timestamp-only searches across many tags. It recommends measuring read benefits with `EXPLAIN (ANALYZE, BUFFERS)`, measuring index density, WAL generation, and insert throughput on production-sized data, and comparing the resulting indexed ingest ceiling with peak rather than average ingestion demand. In the example, the index reduces a dashboard query from roughly 254,000 buffer accesses to 506, but lowers insert throughput by 7.8 percent due partly to scattered insert locations and lower B-tree page density. The guide also advises auditing existing indexes for large, rarely scanned, redundant, or nonessential indexes while preserving unique and constraint-backed indexes, validating changes across a full business cycle, and using concurrent index drops to avoid blocking writes.

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.