~/talk

Why is my query slow? An indexing story

Talkat DDD Perth 2022 · on Saturday, 2022-09-10· [databases]
links:none on file
slides:none on file

Postgres-focused, hands-on guide to why a million-row table suddenly runs in 27 ms and then 0.2 ms after adding the right multi-column B-tree index, or why a sequential scan drops from 33 ms to 11.8 ms with a selective index. Covers creating indexes concurrently, reading planner output with EXPLAIN ANALYZE, using index only scan and partial index to avoid heap fetches, warns of write slowdowns, operator/function pitfalls, selectivity/cardinality thresholds and the rule of thumb that more than five indexes looks smelly.

AI-written summary · about

  1. 0:00Introduction to indexing
  2. 1:25Project and table overview
  3. 2:46Sequential scan explained
  4. 3:49What is a database index
  5. 5:58When to create indexes
  6. 7:22Trade-offs of indexing
  7. 8:25Knowing your queries
  8. 9:27Creating indexes safely
  9. 10:08Debugging with EXPLAIN
  10. 13:16Multi-column indexes
  11. 15:45Selectivity and cardinality
  12. 17:30Indexing strategy
  13. 19:17Range queries and order
  14. 21:05Covering indexes
  15. 23:11Sorting and index order
  16. 25:21Partial indexes
  17. 27:49Function-based indexes
  18. 29:54Why indexes aren't used
  19. 31:57Further learning resources
  20. 33:22Key takeaways and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.