When I run an ActiveRecord query in my local console, I am shown both how long the query took to run (in ms) and the raw SQL that was generated from my ActiveRecord code. For example:
$ rails c
Running via Spring preloader in process 92420
Loading development environment (Rails 6.1.3)
[1] pry(main)> TableName.count
(26336.8ms) SELECT COUNT(*) FROM "table_names"
=> 10005457
But when I run the same query in a Heroku rails console, I don't see the query time or SQL, just the result. Example:
$ heroku run rails c
Running rails c on ⬢ app-name... up, run.9115 (Free)
Loading production environment (Rails 6.1.3)
[1] pry(main)> TableName.count
=> 10005457
If it's relevant, I have gem 'pry-byebug'
and gem 'pry-rails'
installed via my Gemfile (not in the development
group). I'm also using PostgreSQL as my database.