silverstripe/silverstripe-framework — pull request #3434 by JayDevlin (2014-08-25 13:35:18+00:00)
Title: Cached MySQLDatabase->hasTable()

Database->hasField() is heavily used by the ORM and checks hasTable() whether the table exists.

But MySQLDatabase->hasTable() executes "SHOW TABLES LIKE '$SQL_table'" every single time though we should already have all table names through ClassInfo::hasTable().

If cached, we could squeeze a little performance out of it, i.e. the default SilverStripe installation would have two database queries less and 'admin/pages/edit/show/1' would have six queries less.