[ SQL ] SELECT `post`.* FROM `cmf_portal_post` `post` INNER JOIN `cmf_portal_category_post` `relation` ON `post`.`id`=`relation`.`post_id` WHERE `post`.`post_type` = 1 AND `post`.`post_status` = 1 AND `relation`.`category_id` = 5 AND `relation`.`post_id` < 2 AND ( `post`.`published_time` < 1638691195 and `post`.`published_time` > 0 ) ORDER BY `published_time` DESC LIMIT 1 [ RunTime:0.003768s ]
[ EXPLAIN : array ( 'id' => '1', 'select_type' => 'SIMPLE', 'table' => 'post', 'partitions' => NULL, 'type' => 'range', 'possible_keys' => 'PRIMARY,type_status_date', 'key' => 'PRIMARY', 'key_len' => '8', 'ref' => NULL, 'rows' => '1', 'filtered' => '5.55', 'extra' => 'Using where; Using filesort', ) ]
当搜索结果数据为1时,运行时间0.003768s
[ SQL ] SELECT `post`.* FROM `cmf_portal_post` `post` INNER JOIN `cmf_portal_category_post` `relation` ON `post`.`id`=`relation`.`post_id` WHERE `post`.`post_type` = 1 AND `post`.`post_status` = 1 AND `post`.
问题描述:
创建一个内部网络(docker network create ims_network),在这个内部网络跑了两个容器(一个mysql容器,一个python容器),从python容器中向mysql容器中写数据(insert,update)很慢,select很快。
时间:10个insert用了2秒。
问题解决:
[mysqld]
skip-name-resolve
innodb_flush_log_at_trx_commit=0
sync_binlog=0
方法解析:
————————————————
版权声明:本文为CSDN博主「纯真-Cloud」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/chunzhenzyd/article/details/82887269