Docs / MyISAM, InnoDB and write locks
MyISAM, InnoDB and write locks
InnoDB tables are backed up without locking. MyISAM/Aria tables need a short write lock and are always copied in full.
SaintBackup decides automatically
Before each run, the Agent checks the engine of every table in scope (excluding the system database mysql):
- All InnoDB → runs in no-lock mode (
--no-lock): applications keep writing normally throughout the backup. - Some MyISAM/Aria tables → no-lock mode is turned off. MariaDB holds a write lock while those tables are copied. The Agent page on the Center shows a warning with the number of tables.
Why MyISAM costs more
- MyISAM has no change log, so every incremental backup still copies the entire
.MYD/.MYIfiles of the table. - The write-lock duration is proportional to the size of the MyISAM tables.
Converting to InnoDB
We recommend converting tables that are written to frequently. Do it in batches, smaller tables first, during off-peak hours:
SET SESSION sql_mode='';
ALTER TABLE `db`.`ten_bang` ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
Check first: FULLTEXT search on InnoDB has a different minimum word length and stopword list than MyISAM (
innodb_ft_min_token_size), so MATCH … AGAINST results may change. Row counts (COUNT(*)) on large InnoDB tables are slower than on MyISAM.