LoginSignup
3
1

More than 3 years have passed since last update.

1秒で分かる joins, includes, preload, eager_load

Last updated at Posted at 2019-07-29

1秒で分かる部分

メソッド テーブル結合 クエリ 条件絞り込み Association キャッシュ 使い所
joins INNER JOIN 1 条件絞り込み
left_join LEFT OUTER JOIN 1 条件絞り込み
eager_load LEFT OUTER JOIN 1 Assiociation先をRubyで読む
preload なし 1以上 複数Assiciationを先読みしておく場合。複雑なJOINでslow queryになるような場合
includes 場合による 1以上 場合による eager_loadかpreloadを使い分けてる

参考

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1