aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-10-20 17:15:28 -0400
committerPrem Sichanugrist <s@sikachu.com>2011-10-20 17:15:28 -0400
commitf0be2cb19274bb6029f84ca274a72c4d7fbee2d3 (patch)
tree6f8914cebe9dc61dc94eed1a0dec8cbba23c2398 /activerecord/lib/active_record/associations.rb
parentd64e0955d04a40355e312ca4ee57b2c9a8e248cc (diff)
downloadrails-f0be2cb19274bb6029f84ca274a72c4d7fbee2d3.tar.gz
rails-f0be2cb19274bb6029f84ca274a72c4d7fbee2d3.tar.bz2
rails-f0be2cb19274bb6029f84ca274a72c4d7fbee2d3.zip
Add some note on adding index to HABTM table
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rw-r--r--activerecord/lib/active_record/associations.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 2449df079a..34684ad2f5 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1432,6 +1432,10 @@ module ActiveRecord
# end
# end
#
+ # It's also a good idea to add indexes to each of those columns to speed up the joins process.
+ # However, in MySQL it is advised to add a compound index for both of the columns as MySQL only
+ # uses one index per table during the lookup.
+ #
# Adds the following methods for retrieval and query:
#
# [collection(force_reload = false)]