Unexpected SQL queries to Postgres database on Rails/Heroku

前端 未结 4 878
灰色年华
灰色年华 2021-02-07 10:47

I was diving into a really long request to one of my Rails applications using NewRelic and found a number of SQL queries that appear entirely foreign that are taking up a signif

4条回答
  •  逝去的感伤
    2021-02-07 11:28

    I was getting these queries when using Apartment Gem for multitenancy with Postgres Schemas. Apparently each excluded_model - a model that uses default schema - was generating one "pg_class" query in every request.

    The guys from Apartment fixed it in version 0.25.0.

提交回复
热议问题