To log database queries you can run:
./heroku config:set DEBUG='*:sql:*'
You then then see them with other logs at:
./heroku logs -t
Disable these verbose logs once you're done:
./heroku config:unset DEBUG