We were doing some optimizations and noticed that the QueryCache is not being used in our worker process (resulting in some repeated DB calls).
class TestJob < ActiveJob::Base def perform puts ActiveRecord::Base.connection.query_cache_enabled end end => false
It looks like QueryCache is only enabled on each request via the ActiveSupport::Executor. Would it make sense to enable/disable the QueryCache around every job perform? Or wrap calls with the AS::Executor? Also I’d love to hear if there are other places where this would make sense (I’m thinking runner/rake task/console).
Tangentially, this is my first post on this list: many thanks to the Rails team for their continued work, support and leadership over the many many years! I hope you know that through Rails and your dedication to open source you have enabled the company that I work for to bring software solutions to non-profits that otherwise would not have had the possibility to.