~/talk

Speed Up Your Database

Talkat PyCon Canada 2012 · 2012-11-09..11-11· [databases]
slides:none on file

Shows how a simple join on a hand-built dataset of 200 users, 100 albums/user, 100 pictures/album = 2 million pictures goes from 38.0s to 2.38s when adding album.id, to 0.12s with picture.album_id, to 0.10s with album.user_id and down to 0.009s with pagination and tighter WHERE clauses. Uses MySQL slow query log, EXPLAIN output to count scanned rows, points out ORMs N+1 queries and SQLAlchemy listeners, recommends foreign key indexes, small unsigned integers, partitioning/sharding and the archive engine for cold data.

AI-written summary · about

  1. 0:00Introduction and agenda
  2. 1:25Identifying slow queries
  3. 3:31Using slow query logs
  4. 5:38Understanding query execution with EXPLAIN
  5. 7:02How indexes improve performance
  6. 9:11Optimizing joins with indexes
  7. 10:14Database connection limits
  8. 10:57Index design best practices
  9. 11:39Avoiding functions on indexed columns
  10. 12:21Limiting query results
  11. 13:04Table partitioning and archiving
  12. 14:05Splitting databases for load
  13. 14:45Final optimization checklist
  14. 15:48Q&A session
~/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.