Index tuningInvestment firm, anonymized × red9CS-0259
A pricing query run 1,000 times a day, from 2 seconds to a millisecond
The problem. An investment management firm ran a market-data pricing query about 1,000 times a day. Each run took roughly 2 seconds and read 226,488 pages, so a lookup that traders and reporting both depend on was dragging, and the IO piled onto everything else sharing the instance.
What we did. We captured the plan and statistics, then built a covering index tuned to the query's filter and output columns, so the engine seeks a few rows instead of scanning the table end to end. Before and after were recorded in the same session.
Red9 · Performance Impact
SQL capacity reclaimed
~32 min / day
Across ~1,000 daily runs of one pricing query, on the same hardware.
Duration, per run
2,000x
About 2 seconds down to 1 ms.
Disk reads, per run
~45,000x less
226,488 down to 5 per run, IO off the box.
Duration
2 s → 1 ms
2,000x shorter
Disk reads
226,488 → 5
~45,000x less
Executions
~1,000 / day
unchanged
How the math works. Each multiple is the old number over the new one, so 226,488 reads divided by 5 lands near 45,000x. The ~32 minutes reclaimed daily is roughly 1,000 runs a day at the ~2 seconds trimmed off each. Both figures come straight from the firm's own before-and-after captures.
The result. The pricing query now returns in about a millisecond and reads 5 pages instead of 226,488. Across roughly 1,000 runs a day, that gives the firm back about 32 minutes of SQL processing, and the storage load it used to create is off the instance.
The technical detail
What the review found. The pricing query filtered a large market-data table with no supporting index, so every one of its ~1,000 daily calls scanned the table, about 226,488 reads each time.
What we changed (identifiers generalized for privacy):
-- Pricing query scanned the full table: 226,488 logical reads, ~2s per run.
CREATE NONCLUSTERED INDEX IX_market_prices_covering
ON dbo.[market_prices] (/* filter cols */) INCLUDE (/* output cols */);
-- rollback: DROP INDEX script provided
The covering index turned the scan into a seek: reads dropped from 226,488 to 5, and the run fell from about 2 seconds to 1 ms.