Mysql之Copying to tmp table
来源:互联网 发布:php curl下载远程图片 编辑:程序博客网 时间:2024/06/05 19:33
Copying to tmp table这种状态耗时较长,如图
如果查询超出了tmp_table_size的限制,那么用/tmp保存查询结果,tmp_table不得不拷到硬盘上,然后返回给客户端.
解决方案:放大tmp_table_size
1)查询tmp_table_size 为默认16M
MySQL> show variables like '%tmp%';
+-------------------+----------+
| Variable_name | Value |
+-------------------+----------+
| max_tmp_tables | 32 |
| slave_load_tmpdir | /tmp |
| tmp_table_size | 16777216 |
| tmpdir | /tmp |
+-------------------+----------+
4 rows in set (0.00 sec)
/etc/my.cnf添加
tmp_table_size = 256M
2)优化sql
3)拓展-其他常用参数
mysql> show global status like ‘qcache%‘;
Qcache_queries_in_cache 在缓存中已注册的查询数目
Qcache_inserts 被加入到缓存中的查询数目
Qcache_hits 缓存采样数数目
Qcache_lowmem_prunes 因为缺少内存而被从缓存中删除的查询数目
Qcache_not_cached 没有被缓存的查询数目 (不能被缓存的,或由于 QUERY_CACHE_TYPE)
Qcache_free_memory 查询缓存的空闲内存总数
Qcache_free_blocks 查询缓存中的空闲内存块的数目
Qcache_total_blocks 查询缓存中的块的总数目
Qcache_free_memory 可以缓存一些常用的查询,如果是常用的sql会被装载到内存。那样会增加数据库访问速度
- Mysql之Copying to tmp table
- Mysql慢查询之Copying to tmp table
- Mysql慢查询之Copying to tmp table
- mysql查询缓慢SQL State:Copying to tmp table
- Mysql中copying to tmp table事件的相关处理
- mysql慢查询问题(Copying to tmp table)
- Copying to tmp table on disk
- Copying to tmp table 解决方式
- mysql Copying to tmp table on disk 影响性能的解决方法
- MySql操作缓慢:copy to tmp table
- mysql的"Incorrect key file for table '/tmp/#sql_1194_12.MYI'; try to repair it"问题
- Mysql大表数据局未加索引前存在Coping to tmp table耗时比较严重解决方法
- MySQL异常:Incorrect key file for table '/tmp/#sql_37b_1.MYI'; try to repair it
- mysql copy to tmp on disk
- mysql连接之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2
- ERROR 2002: Can't connect to local MySQL server through socket '/tmp/tmp/mysql.sock' (2)
- ERROR 2002: Can't connect to local MySQL server through socket '/tmp/tmp/mysql.sock' (2)
- Zend cannot connect to mysql with /tmp/mysql.sock
- maven与Tomcat包冲突问题
- Binary Tree
- 字符串排序 Java编程练习 学堂在线
- js面试题知识点全解(一原型和原型链1)
- Android-Intent传递数据(Bitmap)闪退问题
- Mysql之Copying to tmp table
- Java web学习笔记
- C# 并行编程 之 Barrier的使用
- 浏览器的缓存机制
- JavaScript基础系列之四 面向对象编程
- java面经整理(1)
- centos7下yum安装php,Apache,mysql
- 纯js 贪吃蛇游戏解析与源码
- GDB(一)用户态gdb调试