Slow Rails JSON 操作

发布于 2024-11-07 20:47:53 字数 21361 浏览 0 评论 0原文

我在 Rails 中有一个缓慢的动作。视图/活动记录和 sphinx 都报告了快速渲染,但总体操作大约需要 1.2 秒。一点也不太好。我想知道这是否可能是因为我正在将大型活动记录集转换为 JSON。这是我的日志输出

Started GET "/genres/popular?page=2&per_page=10" for 127.0.0.1 at 2011-05-17 17:53:04 +1000
[Barista] Compiling all scripts for barista
[Barista] Compiling all coffeescripts
Processing by GenresController#popular as JSON
Parameters: {"page"=>"2", "per_page"=>"10"}
Genre Load (0.5ms)  SELECT `genres`.* FROM `genres` ORDER BY medias_count DESC LIMIT 10 OFFSET 10
SQL (0.3ms)  SELECT COUNT(*) FROM `genres`
Media Load (2.2ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 209)
Genre Load (0.2ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
MediaType Load (0.2ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (3.7ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 14)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 286)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 264)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 270)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 271)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.1ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 36)
Genre Load (0.4ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.1ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 58)
Genre Load (0.4ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.2ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 186)
Genre Load (0.4ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (3.4ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 10)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Completed 200 OK in 1262ms (Views: 209.9ms | ActiveRecord: 28.2ms | Sphinx: 0.0ms)

I've got a slow action in Rails. The view / active record and sphinx all report a fast rendering yet the overall action takes around 1.2 seconds. Not great at all. I'm wondering if it might be because I'm converting a large active record set into JSON. Here's my log output

Started GET "/genres/popular?page=2&per_page=10" for 127.0.0.1 at 2011-05-17 17:53:04 +1000
[Barista] Compiling all scripts for barista
[Barista] Compiling all coffeescripts
Processing by GenresController#popular as JSON
Parameters: {"page"=>"2", "per_page"=>"10"}
Genre Load (0.5ms)  SELECT `genres`.* FROM `genres` ORDER BY medias_count DESC LIMIT 10 OFFSET 10
SQL (0.3ms)  SELECT COUNT(*) FROM `genres`
Media Load (2.2ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 209)
Genre Load (0.2ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
MediaType Load (0.2ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 209) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (3.7ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 14)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 14) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 286)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 286) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 264)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 264) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 270)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 270) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.0ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 271)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 271) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.1ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 36)
Genre Load (0.4ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 36) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.1ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 58)
Genre Load (0.4ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 58) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (2.2ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 186)
Genre Load (0.4ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 186) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Media Load (3.4ms)  SELECT `medias`.* FROM `medias` WHERE (`medias`.genre_id = 10)
Genre Load (0.3ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
CACHE (0.0ms)  SELECT `genres`.* FROM `genres` WHERE (`genres`.`id` = 10) LIMIT 1
CACHE (0.0ms)  SELECT `media_types`.* FROM `media_types` WHERE (`media_types`.`id` = 1) LIMIT 1
Completed 200 OK in 1262ms (Views: 209.9ms | ActiveRecord: 28.2ms | Sphinx: 0.0ms)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琉璃繁缕 2024-11-14 20:47:53

是的,我只需要立即加载媒体即可。铁轨101。

Yep, I just needed to eager load the medias. Rails 101.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文