I need to get list of all tables on server in all databases.
I found out 2 ways for doing that.
1). Execute SHOW FULL TABLES from <each database name> WHERE table_type = 'BASE TABLE';
2). Execute SELECT table_name, table_schema FROM information_schema.tables WHERE TABLE_TYPE = "BASE TABLE";
Questions:
1). Is there any other method then mentioned above that can perform better?
2). Is there any performance difference in executing above two methods?
3). Which of the above two methods is better to execute?
Where possible, I would use
information_schema. It is an ANSI standard, however, access to proprietary features of MySql may require use of the SHOW* functions on occasion.So I guess it depends on your particular situation.