MySQL慢写
插入下表最多需要70秒才能完成: CREATE TABLE IF NOT EXISTS `productsCategories` ( `categoriesId` int(11) NOT NULL, `productsId` int(11) NOT NULL, PRIMARY KEY (`categoriesId`,`productsId`), KEY `categoriesId` (`categoriesId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 该表中大约有100,000行,它占用了7MB磁盘空间。 MySQL中是否有一些设置可以提高写入性能? 我的my.cnf文件如下: log-slow-queries="/var/log/mysql/slow-query.log" long_query_time=1 log-queries-not-using-indexes innodb_buffer_pool_size=4G innodb_log_buffer_size=4M innodb_flush_log_at_trx_commit=2 innodb_thread_concurrency=8 innodb_flush_method=O_DIRECT query_cache_size = 6G key_buffer_size = 284M query_cache_limit = 1024M thread_cache_size = 128 table_cache …