Why is the MySQL Table Data Editor and DDL Scripting slow?

by Aug 20, 2011

I execute a query in MySQL and it returns in 200ms.  I "Execute Edit" the same query and it takes 4 minutes.  I try to Script Object to Window->CREATE and it takes 4 minutes.

Why is it fast to execute, but slow to execute edit?

Response

Niels Gron over 11 years ago
MySQL has performance problems with the system catalog tables in the information_schema database. The initial install of MySQL doesn’t have many objects, so it is fast. But if your MySQL server has many database and many objects in each database, the the queries to extract the object definitions can take a very long time.

Most of the performance problems have to do with the lack of indexes. See the attached screenshot for an example query used to extract the constraints of a table. You can see in the schema browser that the tables queried don’t have indexes. In a default installation, the query is fast. But a server with a large number of databases and objects can change this.

We hope that Oracle optimizes the information_schema database in future versions. If this is causing problems in a current production system, you can try to add indexes and tune the database yourself … although it would seems that you might not have permissions to do so, even as “root”.

Looks like a logged MySQL bug : http://bugs.mysql.com/bug.php?id=19588