4 ms·
My experience has been the exact opposite (even with simple views); the view layer always incurs the most CPU time. With the proper indexes and eager loading,
by aantix 11y ago
My experience has been the exact opposite (even with simple views); the view layer always incurs the most CPU time. With the proper indexes and eager loading, data retrieval is incredibly quick.
- blizkreeg 11y agoSame experience here. View renders have been the dog, the db queries with the right indexes and done smartly, have been fast.
- Rafert 11y agoJust curious, what are you using: ERB, Haml, Slim? According to this gem Haml could be a lot faster, but I haven't had the chance yet to check it out: https://github.com/k0kubun/hamlit https://github.com/k0kubun/hamlit
- anko 11y agoOut of interest, what database do you use? And how many joins do you normally do per view? We use postgres and once you get to around 1m records, even COUNT is slow as it does a full table scan, even with indexes.