~/talk

Exploring Query Optimization: How a few lines of code can save hours of time

Talkat rstudio::conf 2019 · 2019-01-15..01-18· [databases]
slides:none on file

An analyst backfills 4 billion rows into Amazon Redshift, crashes nightly ETLs and turns a seven hour query into under one hour after rewriting the job. Uses EXPLAIN plan to measure estimated cost, changes table distribution to dist style key (choosing session_id for joins) and adds a sort key on session_start_time so WHERE filters avoid full-table scans. Result: runtime drops by ~6 hours, joins use all compute nodes, and temporary session-level tables become efficient for downstream joins.

AI-written summary · about

  1. 0:00Query optimization intro
  2. 1:11Disastrous backfill experience
  3. 5:10Query optimization basics
  4. 7:41Distribution styles
  5. 9:31Sort keys power
  6. 11:40Optimizing real queries
  7. 13:52Results and lessons
  8. 14:53Final tips
~/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.