This project is archived and is in readonly mode.

#6726 new
Kirill Maximov

[PATCH] Speedup associations preloading when multiple options are used in :include (2.3.x branch)

Reported by Kirill Maximov | April 19th, 2011 @ 10:18 PM


When ActiveRecord's find() option :include => [a lot of stuff], the current association preloading code may be not very efficient, because it calls flatten.compact.uniq for each option for :include.

This can be done only once, and this really improves performance when there are hundreds of records for which associations are preloaded.

The fix is very simple, please see the attached patch.

2.3.x is still alive, I belive :)

Thanks, KIR

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket