服务器配置:
内存64G
下面是mysql的my.cnf配置:
[mysqld]
port =3306
socket = /opt/dc_mysql/data/mysql.sock
skip-external-locking
key_buffer =384M
max_allowed_packet = 16M
table_cache =1024
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 64
query_cache_size= 32M
max_connections = 180
max_connect_errors = 128
max_error_count = 128
max_heap_table_size=512M
tmp_table_size=512M
join_buffer_size = 8M
#open_files_limit = 4048
# Try number of CPU's*2 for thread_concurrency
thread_concurrency =32
请求高手调优mysql。非常感谢。
试了sort_buffer_size = 2M read_buffer_size = 2M。还是有报错。问题sql是更新字段。sql比较长。
这个SQL的业务场景过于复杂,可以拆分成两个SQL,分别赋值;或者把统计的工作提前进行。
你把explain这个语句的截图贴上来,可以再分析下。