~/talk

"Optimizing SQL Queries"

Talkat RubyC 2017 · 2017-06-03..06-04· [databases]
links:none on file
slides:none on file

Application code causes most slowdowns (about 90% vs 10% for webserver); queries under 10ms are often network/IO bound, queries over 50ms are true slow paths. Practical fixes: use Rails features like inverse_of and counter_cache, prefer a unique index instead of validation queries, add domain conditions (site_id, date ranges) to steer index choice, and cache higher when needed with key‑value stores and ETag/versioned responses. Watch out: indexes can eat ~70% of DB size. A triple‑nested SELECT for leaderboard ranking proves fast in practice.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 4:20Why optimize SQL queries
  3. 7:13Avoiding unnecessary queries
  4. 11:56Optimizing with indexes
  5. 15:55Caching tables and data
  6. 21:14Query execution plans
  7. 25:31High-level caching strategies
  8. 30:00Optimization steps summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.