InnoDB performance tuning tips.
InnoDB, make sure MySQL does not have autocommit mode enabled because it requires a log flush to disk for every insert.
autocommit during your import operation, surround it with
SET AUTOCOMMIT and
COMMIT statements:
SET AUTOCOMMIT=0;... SQL import statements ...COMMIT;
mysqldump --opt dump files are fast to
import into an InnoDB table, even without
wrapping them with the SET AUTOCOMMIT and
COMMIT statements.
InnoDB uses the insert buffer to save disk
I/O in inserts, but no such mechanism is used in a
corresponding rollback.
DROP TABLE and CREATE TABLE to empty a table.
DELETE FROM tbl_name.
INSERT syntax to
reduce communication overhead between the client and the server.
FOREIGN KEY constraints are in
tables, speed up table imports by turning the foreign
key checks off for the duration of the import session.
SET FOREIGN_KEY_CHECKS=0;... import operation ...SET FOREIGN_KEY_CHECKS=1;
How does InnoDB implement versioning?
© 2007 John Michael Pierobon