Project

General

Profile

Actions

Refactor #16245

open

Don't use eager_load when not needed

Added by Tomer Brisker almost 8 years ago. Updated almost 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

ActiveRecord::QueryMethods#eager_load executes a LEFT OUTER JOIN and loads all table columns from all requested tables.
In many cases, an INNER JOIN will be enough as we are only interested in filtering according to the added relation and do not need all the data from that relation.
In these cases, `eager_load` should be replaced by `joins` which will perform the INNER JOIN needed and will be much more efficiant.

Actions #1

Updated by Ohad Levy almost 8 years ago

is this supposed to be a tracker?

Actions

Also available in: Atom PDF