View : <% @tollprojects.each do |tollproject| %>
…… SQL : CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."tollproject_id" = 1 LIMIT 1 CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."tollproject_id" = 2 LIMIT 1 CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."id" = $1 LIMIT 1 [["id", 1]] CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."tollproject_id" = 3 LIMIT 1 CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."id" = $1 LIMIT 1 [["id", 1]] CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."tollproject_id" = 4 LIMIT 1 CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."id" = $1 LIMIT 1 [["id", 1]] CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."tollproject_id" = 5 LIMIT 1 CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."id" = $1 LIMIT 1 [["id", 1]] CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."tollproject_id" = 6 LIMIT 1 CACHE (0.0ms) SELECT "tollprojects".* FROM "tollprojects" WHERE "tollprojects"."tollproject_id" = 7 LIMIT 1
数据多就很慢,不太明白为何要 一条记录对应一个查询。 是否有其他处理的办法?