<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>subaru-hello</author_name>
  <author_url>https://blog.hatena.ne.jp/subaru-hello/</author_url>
  <blog_title>subaru-hello’s blog</blog_title>
  <blog_url>https://subaru-hello.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>今回は、N+1問題について勉強していきたいと思います。 N+1問題とは N+1問題とは、はじめの1回のSQLでModelを取得し、そのModelに対するデータ数分(N回)のSQLが実行されてしまう状態のことを言う。 順番から考えると、N+1問題というよりは1+N問題と呼んだ方がイメージしやすいかと思います。 また、N+1問題を検知するgemで「bullet」というものがある。.preload、eager_load、includeを追加しなくても勝手にN+1問題を解決してくれる優れもの。 allを使った場合とincludeを使った場合を比較してN+1問題を理解してみましょう。 allを使用した場…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsubaru-hello.hateblo.jp%2Fentry%2F2021%2F09%2F02%2F073042&quot; title=&quot;N+1問題（include,preload,eagar_load） - subaru-hello’s blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://i.gyazo.com/03381abc25abdc2b16e569af2d19bcee.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-09-02 07:30:42</published>
  <title>N+1問題（include,preload,eagar_load）</title>
  <type>rich</type>
  <url>https://subaru-hello.hateblo.jp/entry/2021/09/02/073042</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
