I would like to know which table is responsible for the moodle outline report, since to generate this type of report it is taking more than 4 minutes to render on the screen, the moodle version is 3.2
Without checking the code very much... these sort of reports generally use the log table (mdl_logstore_standard_log). On a busy site, that table can get *very* big.