When retrieving logs for a scheduled task it might take up to 10 seconds to display the report.
Steps to replicate:
- Navigate to Site administration > Server > Tasks > Scheduled tasks page.
- Choose some task and click "View logs for <task name>" link.
- Check how long does it take to display the report.
Profiling gives the following:
This is because Task logs page searches by both classname and output columns by default: https://github.com/moodle/moodle/blob/0b69b37f04c055d7a81c38f3279555c1f51a61f3/admin/classes/task_log_table.php#L95-L96
It's okay when you are navigating to this page directly and looking for all logs that have some string mentioned. However, it would be enough to search by classname only when you need to get all logs for a given scheduled or adhoc task.