To enable slow query logging, add 'logslow' => true
to the 'dboptions' array in config.php.
This will cause slow queries to be logged in the 'log_queries' table in the database. This table can also be export and sent to Totara Support.
Only enable slow query logging long enough to test slow queries and immediately disable after testing.