I have the following mysqldump file . I have 3 questions:
1. Are the commands within /* */
commented out or are they actually getting executed?
2. According to the official MySQL documentation it says:
The mysqldump option --opt creates dump files that are fast to import into an InnoDB table, even without wrapping them with the SET autocommit and COMMIT statements. opt is enabled by default
But mysqldump
file didn’t include SET auto commit
and COMMIT
statements, I’m wondering if those are implicit? Or do I need to add them.
3. Even when I set unique_checks=0
and foreign_key_checks=0
, if I have non-unique key, I should probably remove these keys prior to the bulk insert, and then re-add them afterwards, in order to gain performance, right?
-- Server version 5.6.10-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
LOCK TABLES `xxx` WRITE;
/*!40000 ALTER TABLE `xxx` DISABLE KEYS */;