aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/rails_info_test.rb
diff options
context:
space:
mode:
authorJordan Lewis <jordanthelewis@gmail.com>2017-01-19 15:29:17 -0500
committerJordan Lewis <jordanthelewis@gmail.com>2017-01-30 11:27:04 -0500
commitf9c6cbd55c56de7994b74630acd141c324411719 (patch)
tree714d0b6a3dd14b3e765cfda634fb6987ce4809ed /railties/test/rails_info_test.rb
parentd5651436d64c1a3f0b95910cb66c13bb29229f46 (diff)
downloadrails-f9c6cbd55c56de7994b74630acd141c324411719.tar.gz
rails-f9c6cbd55c56de7994b74630acd141c324411719.tar.bz2
rails-f9c6cbd55c56de7994b74630acd141c324411719.zip
Simplify Postgres query for column_definitions()
column_definitions() needs to fetch the collation for every column, if present. Previously, it did so using a correlated subquery - a subquery that references results from the outer scope. This patch updates the query to remove the subquery in favor of a simpler and more efficient JOIN clause. Running the two queries through EXPLAIN against Postgres additionally shows that the original form with a correlated subquery requires a Nested Loop Left Join, while the new form with a simple JOIN can use a more efficient Merge Left Join.
Diffstat (limited to 'railties/test/rails_info_test.rb')
0 files changed, 0 insertions, 0 deletions