← Graph

Aren't query optimizations a better first step than caching?

question 2 connections

Audience remark that optimizing queries and eager-loading can remove the need for caching and avoid premature optimization. Speaker agrees generally but shows that in the talk's example only ~3ms of ~497ms is in ActiveRecord; the dominant cost is view rendering, so fragment caching is the bigger lever. In Phoenix the balance typically reverses.

answer_summary
Optimize queries first in principle, but in this Rails example the view rendering (not AR) dominates, so fragment caching is the bigger win.
question Aren't query optimizations a better first step than caching?
about
Contrasts query optimization with view-layer caching.
question Aren't query optimizations a better first step than caching?
asked_at
Audience Q&A remark.

Provenance

Read by
7 extractions