Slow Rails JSON 操作
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,我只需要立即加载媒体即可。铁轨101。
Yep, I just needed to eager load the medias. Rails 101.