我正在设置一个新的服务器,并且想要将现有的phpBB安装移到那里。一切都很好,除了一个SELECT在慢日志中,并且永远消耗CPU。我不是数据库专家,所以我迷路了。
旧服务器- Win2008 R2、MySQL 5.7.24、php 5.6.39、单i7四核处理器、24 R2内存
新服务器- Win2016、MySQL 8.0.15、php 7.1.5、双至强CPU、96 RAM内存
我尝试打开每个表并检查错误,执行了mysql_upgrade,结果为OK。有问题的选择是:
SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option
FROM phpbb_acl_groups a, phpbb_user_group ug, phpbb_groups g, phpbb_acl_roles_data r, phpbb_acl_options ao
WHERE a.auth_role_id = r.role_id AND r.auth_option_id = ao.auth_option_id
AND a.group_id = ug.group_id
AND g.group_id = ug.group_id
AND ug.user_pending = 0
AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
AND ao.auth_option = 'm_';在旧服务器上,select是立即完成的。在新服务器上,它持续25 - 30秒。查看图片-查看“检查的行”。但是所有的桌子看起来都没问题。
旧服务器my.ini如下所示:
max_connections=151
table_open_cache=2000
tmp_table_size=922M
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=3G
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=1024M
innodb_log_file_size=128M
innodb_thread_concurrency=17
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000新的服务器my.ini如下所示:
max_connections=151
table_open_cache=2000
tmp_table_size=5G
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=10G
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=2048M
innodb_log_file_size=128M
innodb_thread_concurrency=24
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000发布于 2019-04-11 00:04:08
所以,我:
不走运。
因此,作为最后一次尝试,我下载了当前的mysql 5.7.25版本,并猜猜它是如何工作的。
那么有没有可能是MySQL 8.x分支中的某个bug呢?我看不到任何其他的解释。
发布于 2019-04-12 22:57:22
此url https://dev.mysql.com/doc/relnotes/mysql/8.0/en/表示8.0.15的GA发布日期为2019-02-01。任何时候,当你进入一个GA少于90天的版本时,你就表明了你愿意发现/报告遗漏的bug。你做出了一个明智的决定,回到5.7版本,在这个领域的成功史上有一些实际意义。您可能希望在一般可用后180天建立,以防止发现/报告或暴露于尚未更正的错误。
https://stackoverflow.com/questions/55576610
复制相似问题