-
Bug
-
Resolution: Fixed
-
Minor
-
3.8.2
-
MOODLE_38_STABLE
-
MOODLE_37_STABLE, MOODLE_38_STABLE
-
introduced new behavior with temporary tables and the database cache; the creation and deletion of temporary tables isn't supposed to force a cache reload. This works on table creation but not deletion. The issue is that the temporary table is unlisted as such before the cache is reset, so the cache reset code doesn't know it was a temporary table and resets the whole cache. This leads to performance issues if you're running a job which creates and deletes numerous temporary tables, such as mass-creation of backups.MDL-51374
This is the order of operations when deleting a temporary table:
- database_manager->drop_table()
- sql_generator->getDropTableSQL()
- moodle_temptables->delete_temptable()
- database_manager->execute_sql_arr()
- moodle_database->change_database_structure()
- moodle_database->reset_caches()
- moodle_database->change_database_structure()
- sql_generator->getDropTableSQL()
To get the desired behavior I think the code in delete_temptable() needs to fire after the cache is reset. While examining my development environment I saw SHOW TABLE queries and column parsing after every backup and restore operation.
- has been marked as being related by
-
MDL-58584 Deleting a temporary table forces a reload of the databasemeta cache
- Closed