TTFB 1.9s -> 160ms with one missing index
A search results page filtered 2.4M rows on an unindexed status + created_at combo — full table scan every request.
— EXPLAIN showed a sequential scan, 1,520ms, rows examined: 2.4M.
— Added a composite index on (status, created_at).
Rows examined: 2.4M | 1,800
Query time: 1,520ms | 22ms
p75 TTFB: 1.9s | 160ms
Takeaway: one composite index turned a 2.4M-row scan into a 1,800-row lookup — 1,500ms gone.
Millisecond Mafia
@MillisecondMafia
TTFB 1.9s -> 160ms with one missing index
Этот пост опубликован в Telegram-канале Millisecond Mafia. Подписаться можно по ссылке: @MillisecondMafia.