robmorgan/phinx — pull request #316 by svemir (2014-09-22 20:57:38+00:00)
Title: Improve performance of hasTable

I know this might be a bit controversial, but current approach should change one way or another.

Running "SHOW TABLES" every time we need to check if a single table exists is a non-starter for us. In our own systems we had to change table existence checks to the approach proposed here even though we were already caching everything aggressively.

In a system such as phinx, caching would make no sense since creating and dropping tables happens all the time. However, if this request is deemed too much of a hack, there should at least be some attempt to keep track of tables being dropped and created, so that we do not have to run the full SHOW TABLES on every call to hasTable.