~/talk

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

Talkat rstudio::conf(2022) · 2022-07-25..07-28· [databases]
slides:none on file

Backfilling 1.5 years of clickstream (4 billion rows) on Amazon Redshift crashes nightly ETLs until a few changes cut runtime from seven+ hours to under one hour. Use an EXPLAIN plan to see estimated cost before waiting, pick dist style key and choose the dist key that matches join columns (event_id or session_id), and set a sort key on session_start_time so WHERE filters avoid full-table scans; aggregate pageviews to sessions before joining.

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.