Commit 75e7f81
perf(cdc-graph): add composite (flow_name, start_time) index for CDCGraph
The CDCGraph query range-joins generate_series ticks against
peerdb_stats.cdc_batches per bucket. The pre-existing indexes are a HASH
on flow_name and a btree on start_time, which cannot be combined in a
single scan, so each per-bucket probe scans a start_time range and
filters flow_name as a recheck.
Add a composite (flow_name, start_time) index so each probe is a single
tight index range scan. Benchmarked against ~1.05M batches for one flow:
buffers touched for the 30h window drop from 3844 to ~180 (~20x less
I/O), with matching reductions in cache pressure on large tables.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent cf1e119 commit 75e7f81
1 file changed
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments