~/talk

Processing data: Ruby or SQL?

Talkat RubyConf TH 2022 · 2022-12-09..12-10· [databases, ruby]
slides:none on file

Compares doing numeric work in Ruby versus pushing it into the database using TimeScaleDB and the TimeScaleDB toolkit, measuring real run times and where time is spent. Generates ~50k records with generate_series, uses array_agg and lag or the toolkit pipeline operators to compute volatility; SQL path costs ~54 ms end‑to‑end while Ruby fetch+process takes ~190 ms (fetch ~116 ms, Ruby processing ~74 ms). Shows a 400k‑row downsampling where SQL returns under a second and Ruby takes ~3 seconds, concluding IO/serialization is the usual bottleneck.

AI-written summary · about

  1. 0:00Introduction
  2. 1:06Ruby vs SQL speed
  3. 7:50Data processing benchmarks
  4. 12:27Volatility algorithm vs SQL
  5. 16:27Ruby vs SQL benchmarks
  6. 21:07Query planning costs
  7. 24:01Hardware and data access
  8. 26:06Data pipes trade-offs
  9. 27:52Live demo: downsampling
  10. 29:58I/O vs CPU bottlenecks
~/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.