Site icon David Yin's Blog

MyISAM and innodb engine

I have a VM that hosts a few websites there.  Today, I ran the mysqltuner.pl script to check the performance and see if there is any recommondation.

-------- Recommendations -------------------------------------------------------                                                                                                                                                             --------------------
General recommendations:
    Configure your accounts with ip or subnets only, then update your configurat                                                                                                                                                             ion with skip-name-resolve=ON
    Performance schema should be activated for better diagnostics
    MyISAM engine is deprecated, consider migrating to InnoDB
    Be careful, increasing innodb_log_file_size / innodb_log_files_in_group mean                                                                                                                                                             s higher crash recovery mean time
Variables to adjust:
    skip-name-resolve=ON
    table_definition_cache (400) > 1126 or -1 (autosizing if supported)
    performance_schema=ON
    key_buffer_size (~ 25M)
    innodb_buffer_pool_size (>= 770.7M) if possible.
    innodb_log_file_size should be (=32M) if possible, so InnoDB total log file                                                                                                                                                              size equals 25% of buffer pool size.
    innodb_log_buffer_size (> 16M)

I know I have a database with over 900M data. There are 67 tables in the MyISAM engine. It was created about 10 years ago. Still use MyISAM. All other databases are powered by the innodb database engine.

I want to know the main difference between MyISAM and innodb.

The two most commonly used MySQL storage engines are MyISAM and InnoDB. The key differences, especially in terms of performance, are:

1. Transaction Support

2. Concurrency & Locking

3. Performance

4. Data Integrity & Crash Recovery

5. Foreign Keys & Data Integrity

The mysqltuner.pl report said that MyISAM engine is deprecated.

MyISAM Deprecation Status:

Why is MyISAM Deprecated?

  1. Lack of Transactions – Modern databases need ACID compliance, which MyISAM lacks.
  2. Poor Crash Recovery – MyISAM tables can easily get corrupted after a crash, requiring manual repair.
  3. Table-Level Locking – This severely limits performance in high-concurrency environments.
  4. No Foreign Keys – InnoDB supports referential integrity, which is essential for relational databases.
  5. MySQL Development Focus – MySQL has shifted entirely toward InnoDB, with performance optimizations and new features being developed only for it.

So the question is how to migrate the MyISAM tables to the InnoDB tables.

 

ALTER TABLE your_table ENGINE=InnoDB;

I will convert all 67 tables to innodb engine. And wait a few days to run mysqltuner.pl again.

It took me about two hours to convert the MyISAM tables to InnoDB. There are two big tables. One is over 500MB. I did three steps: Alter, Optimization, Analyze. To make sure they are good to go.

Exit mobile version