Mysql: INNODB performance insert versus MYISAM

I insert into a simple small table with 5 attributes and 1000 rows.

I observed when the INNODB engine, each insert takes 0.03-0.05 seconds. I changed the engine to MYISAM, then insert faster. it takes 0.001 to 0.003.

What is the problem. innodb_flush_log_trx_commit = 1 by default. I was as I am. Here is my innodb installation.

innodb_log_buffer_size : 1MB innodb_log_file_size : 5MB innodb_buffer_pool_size: 8MB innodb_flush_log_trx_commit = 1 

I could not understand what went wrong. Thanks in advance. Sincerely, Uday

+6
source share
1 answer

innodb_flush_log_at_trx_commit = 1 means that each transaction is written to the log buffer.

Set it to 0 to get better performance, or even better try doing all the inserts in one transaction (don't forget to comment at the end).

You can look at http://dev.mysql.com/doc/refman/4.1/en/innodb-parameters.html for more details on innodb_flush_log_at_trx_commit and other variables

+3
source

Source: https://habr.com/ru/post/913001/


All Articles