diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-03-13 21:46:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 21:46:36 -0400 |
commit | 192db64452d148c7b51713979459e38407380dc6 (patch) | |
tree | bfefea8594540e212cc13d9d2742b48e23766c8d /activerecord/lib/active_record/connection_adapters | |
parent | 9893955363cf6358556ed3b36f4538d5b54e9d17 (diff) | |
parent | 3997f8ea966b6fd6bac7966f61ab4b3447e55b77 (diff) | |
download | rails-192db64452d148c7b51713979459e38407380dc6.tar.gz rails-192db64452d148c7b51713979459e38407380dc6.tar.bz2 rails-192db64452d148c7b51713979459e38407380dc6.zip |
Merge pull request #28369 from mylake/reduce-postgresql-adapter-memory-bloat
500x memory reduction of 10k schemas for postgresql adapter
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 22c37abb78..9f419f909f 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -568,13 +568,13 @@ module ActiveRecord if supports_ranges? query = <<-SQL - SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype + SELECT DISTINCT on (t.typname) t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype FROM pg_type as t LEFT JOIN pg_range as r ON oid = rngtypid SQL else query = <<-SQL - SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, t.typtype, t.typbasetype + SELECT DISTINCT on (t.typname) t.oid, t.typname, t.typelem, t.typdelim, t.typinput, t.typtype, t.typbasetype FROM pg_type as t SQL end |