~/talk

Powerful Data: Making Rails Apps Faster with Aggregation

Talkat RubyConf 2026 · 2026-07-14..07-16· [ruby-on-rails, databases]
linkedin:nehaabraham
slides:none on file

Dashboards slow because Rails pulls data into Ruby for joins and math; moving summaries into aggregate tables and using ActiveRecord’s group or hand-written raw SQL pushes work to the database and removes joins. Concrete wins: a 15s query becomes ~100ms (~150x), a 90s query drops to 4s (≈2143%), and a nightly job falls from ~4+ hours to under 1 hour by removing one index and adding two composite indexes. Use EXPLAIN, benchmark.measure, and a production-scale DB clone to validate changes.

AI-written summary · about

  1. 0:00Powerful Data in Rails
  2. 1:49Dashboard challenges with large datasets
  3. 2:54Aggregation and query speed
  4. 4:17Efficient aggregate models
  5. 5:19Trade-offs of aggregate tables
  6. 6:21Rails vs database aggregation
  7. 9:30Limitations of Rails group
  8. 10:33Raw SQL for aggregations
  9. 12:41Risks of raw SQL
  10. 14:04Database indexes for performance
  11. 15:47Indexes and background jobs
  12. 16:50Test coverage importance
  13. 17:54Pipeline performance benefits
  14. 18:57Recommendations and call to action
  15. 19:59Q&A on aggregate tables
  16. 20:41Multi-resolution dashboard data
  17. 21:42Reusable vs custom aggregations
  18. 22:03Benchmarking Rails queries
  19. 23:07Aggregation vs materialized views
  20. 23:28Accurate benchmarking
~/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.