Frequently Asked Questions with answers.
Questions
12.1: When a model is exported using the main menu item File, Export, Forward Engineer SQL CREATE Script, some server variables are temporarily set to enable faster SQL import by the server. The statements added at the start of the code are:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
These statements function as follows:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS,
UNIQUE_CHECKS=0;
- determines if an InnoDB
engine performs duplicate key checks. Import is much
faster for large data sets if this check is not performed.
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0;
- determines if the
server should check that a referenced table exists when
defining a foreign key. Due to potential circular
references, this check must be turned off for the duration
of the import, in order to allow defining foreign keys.
SET @OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='TRADITIONAL';
- sets
SQL_MODE
to
TRADITIONAL
, causing the server to
operate in a more restrictive mode.
These server variables are then reset at the end of the script using the following statements:
SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
12.2: MySQL Workbench 5.0 appears to run slowly. How can I increase performance?
Questions and Answers
12.1: When a model is exported using the main menu item File, Export, Forward Engineer SQL CREATE Script, some server variables are temporarily set to enable faster SQL import by the server. The statements added at the start of the code are:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
These statements function as follows:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS,
UNIQUE_CHECKS=0;
- determines if an InnoDB
engine performs duplicate key checks. Import is much
faster for large data sets if this check is not performed.
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0;
- determines if the
server should check that a referenced table exists when
defining a foreign key. Due to potential circular
references, this check must be turned off for the duration
of the import, in order to allow defining foreign keys.
SET @OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='TRADITIONAL';
- sets
SQL_MODE
to
TRADITIONAL
, causing the server to
operate in a more restrictive mode.
SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
12.2: MySQL Workbench 5.0 appears to run slowly. How can I increase performance?
Although graphics rendering may appear slow, there are several other reasons why performance may be less than expected. The following tips may offer improved performance:
Upgrade to the latest version. MySQL Workbench 5.0 is still being continually maintained and some performance-related issues may have been resolved.
Limit the number of steps to save in the Undo History facility. Depending on the operations performed, having an infinite undo history can use a lot of memory after a few hours of work. In Tools, Options, General, enter a number in the range 10 to 20 into the Undo History Size spinbox.
Disable relationship line crossing rendering. In large diagrams, there may be a significant overhead when drawing these line crossings. In Tools, Options, Diagram, uncheck the option named Draw Line Crossings.
Check your graphics card driver. The GDI rendering that is used in MySQL Workbench 5.0 is not inherently slow, as most video drivers support hardware acceleration for GDI functions. It can help if you have the latest native video drivers for your graphics card.
Upgrade to MySQL Workbench 5.1. MySQL Workbench 5.1 has had many operations optimized. For example, opening an object editor, such as the table editor, is much faster, even with a large model loaded. However, these core optimizations will not be back-ported to 5.0.