Мне не ясно, почему в моем приложении на Rails мои запросы такие большие, например, у меня такие проблемы:
Recipe Load (4.0ms) SELECT `recipes`.* FROM `recipes` WHERE (recipes.id > 394691) ORDER BY recipes.id LIMIT 500
Ingredient Load (6.3ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394692)
Step Load (1.7ms) SELECT `steps`.* FROM `steps` WHERE (`steps`.recipe_id = 394692)
Ingredient Load (0.6ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394693)
Step Load (0.2ms) SELECT `steps`.* FROM `steps` WHERE (`steps`.recipe_id = 394693)
Ingredient Load (0.3ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394694)
Step Load (0.2ms) SELECT `steps`.* FROM `steps` WHERE (`steps`.recipe_id = 394694)
Ingredient Load (0.4ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394695)
Step Load (0.2ms) SELECT `steps`.* FROM `steps` WHERE (`steps`.recipe_id = 394695)
Ingredient Load (0.3ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394696)
Step Load (0.2ms) SELECT `steps`.* FROM `steps` WHERE (`steps`.recipe_id = 394696)
Ingredient Load (0.3ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394697)
Step Load (0.2ms) SELECT `steps`.* FROM `steps` WHERE (`steps`.recipe_id = 394697)
Ingredient Load (0.3ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394698)
Step Load (0.2ms) SELECT `steps`.* FROM `steps` WHERE (`steps`.recipe_id = 394698)
Ingredient Load (0.3ms) SELECT `ingredients`.* FROM `ingredients` WHERE (`ingredients`.recipe_id = 394699)
[... goes on for like 20 more rows ...]
Почему так много запросов, мне нужно использовать :include
или что-то еще, я просто не уверен, куда идти с этим.