diff options
author | Ernie Miller <ernie@erniemiller.org> | 2013-08-30 05:10:54 -0700 |
---|---|---|
committer | Ernie Miller <ernie@erniemiller.org> | 2013-08-30 05:10:54 -0700 |
commit | a1a46fd8c2a3d53e02e2e58ca575b2596646b2c3 (patch) | |
tree | 6d0d6614a49403bd80d81658d0f285f73bf7be6e /lib/arel | |
parent | 4524c7f8a8225677893e0731f40993de17d4babc (diff) | |
parent | 707554e6a8b125cf6bdbc9214be4407ba4b624b3 (diff) | |
download | rails-a1a46fd8c2a3d53e02e2e58ca575b2596646b2c3.tar.gz rails-a1a46fd8c2a3d53e02e2e58ca575b2596646b2c3.tar.bz2 rails-a1a46fd8c2a3d53e02e2e58ca575b2596646b2c3.zip |
Merge pull request #206 from SamSaffron/master
Improve performance of #uniq across a large number of nodes
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/table.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb index 5fb1254d17..ef109afe95 100644 --- a/lib/arel/table.rb +++ b/lib/arel/table.rb @@ -124,7 +124,10 @@ Arel 4.0.0 with no replacement. PEW PEW PEW!!! end def hash - [@name, @engine, @aliases, @table_alias].hash + # Perf note: aliases, table alias and engine is excluded from the hash + # aliases can have a loop back to this table breaking hashes in parent + # relations, for the vast majority of cases @name is unique to a query + @name.hash end def eql? other |