Railsã¢ããªã«ã¦è«çåé¤ã¨eager_loadãåããã¦ä½¿ãã¨N+1åé¡ãçºçãããã¨ã«æ°ã¥ããã®ã§ã¡ã¢ã N+1åé¡ã確èªãã ã¾ãã¯N+1åé¡ãèµ·ãããããªã¢ãã«ãä½æãã¾ããããããããã°ã¢ããªã®ãããªãããã°ã®ã¨ã³ããªããããããã«ã³ã¡ã³ããè¤æ°ãããã¿ã¼ã³ã§ãã class Post < ActiveRecord::Base attr_accessible :title, :content has_many :comments end class Comment < ActiveRecord::Base attr_accessible :post_id, :name, :content belongs_to :post end é©å½ãªãã¼ã¿ãå ¥ããå¾ãããã«å¯¾ãã¦rails cã§ä»¥ä¸ã®ããã«ã¬ã³ã¼ããåå¾ãã¾ãã Post.all.each do |post| puts po
{{#tags}}- {{label}}
{{/tags}}