tmp_table_size
Whenever you increase tmp_table_size and max_heap_table_size, keep in mind that setting these does not make queries behave better. It actually make inefficient queries behave worse than before. Under what circumstances?
When a query performs a join or sort (via ORDER BY
) without the benefit of an index, a temp table has to be formed in memory. This would increment Created_tmp_tables.
What if the temp table grows to the number of bytes in tmp_table_size and needs more space? The following sequence of events happens:
- Query processing must stop
- Create a temp table on disk
- Transfer the contents of the memory-based temp table into the disk-based temp table
- Drop in the memory-based temp table
- Query processing continue using the disk-based temp table
This process increments Created_tmp_disk_tables
Knowing these mechanisms, let's explore what happened in each instance
disk tables decreased from 27.37% to 21.70% -> expected much more
This could easily happen if the queries that ran before have cached results remaining in RAM. This would eliminate the need to process the query from the beginning and not recreate the same large temp tables.
temporary files rise form 1.16% to 33.75% -> why ?
This is not surprising. This simply brings out the fact that there are queries that require temp tables. They were created in RAM first. This just indicates the presence of queries that do not join well (maybe join_buffer_size is too small) or ORDER BY
non-indexed columns or columns with a temp table (maybe sort_buffer_size is too small).
memory tables decreased from 71.48% to 44.55% -> strange; expected to rise
This is not surprising either. If there are enough calls for the same query with the same values, sorts and joins may be preempted by the fulfillment of queries from previously cached results.
RECOMMENDATION
tmp_table_size的更多相关文章
- mysql 参数:[read_buffer_size] [sort_buffer_size] [read_rnd_buffer_size] [tmp_table_size]---图解
http://imysql.cn/2008_09_27_deep_into_mysql_sort_buffer http://my.oschina.net/realfighter/blog/36442 ...
- MYSQL增加tmp_table_size 的操作
最近有张表经常损坏,修复后还是会出现损坏. dba分析有可能是临时表空间太小导致的.以下是设置临时表空间大小的操作. 设置 tmp_table_size的大小 mysql> set global ...
- mysql - tmp_table_size & max_heap_table_size
Command-Line Format --tmp_table_size=# System Variable Name tmp_table_size Variable Scope Global, Se ...
- tmp_table_size ---> 优化 MYSQL 经验总结
数据库连接突然增多到1000的问题 查看了一下,未有LOCK操作语句. 但是明显有好多copy to tmp table的SQL语句,这条语读的时间比较长,且这个表会被加读锁,相关表的update语句 ...
- [原] KVM 环境下MySQL性能对比
KVM 环境下MySQL性能对比 标签(空格分隔): Cloud2.0 [TOC] 测试目的 对比MySQL在物理机和KVM环境下性能情况 压测标准 压测遵循单一变量原则,所有的对比都是只改变一个变量 ...
- 在 Windows7 上按照 MySQL5.7
在 Windows7 上按照 MySQL5.7 1.从官网下载最新版本的 MySQL,这里下载的是 mysql-5.7.17-win32: 2.将下载的 mysql-5.7.17-win32.zip ...
- Mysql 中 show full processlist
processlist命令的输出结果显示了有哪些线程在运行,可以帮助识别出有问题的查询语句,两种方式使用这个命令. 1. 进入MySQL/bin目录下输入mysqladmin processlist; ...
- MySQL多实例安装
1.安装MySQL需要的依赖的包和编译软件 (1)安装MySQL需要的依赖包 安装MySQL之前,最好先安装MySQL需要的依赖包,不然后面会出现报错,还得回来安装MySQL的依赖包. [root ...
- MYSQL数据库的优化
我们究竟应该如何对MySQL数据库进行优化?下面我就从MySQL对硬件的选择.MySQL的安装.my.cnf的优化.MySQL如何进行架构设计及数据切分等方面来说明这个问题. 服务器物理硬件的优化 在 ...
随机推荐
- [转]HttpURLConnection的使用
/* * URL请求的类别分为二类,GET与POST请求.二者的区别在于: * a:) get请求可以获取静态页面,也可以把参数放在URL字串后面,传递给servlet, * b:) post与get ...
- Appcan跨域交互
案例1,sina微博登录,没有插件,因此采用web方式,我首先打开https://api.weibo.com/oauth2/authorize--,然后我想增加 一个取消按钮: 1 首先打开sina ...
- Frame练习-打开图片
import java.awt.EventQueue; import java.awt.event.*; import java.io.*; import javax.swing.*; public ...
- Java中类型的长度
介绍: Java中有8种基本类型,分别是boolean, char, byte, short, int, long, float, double.他们的长度固定,不是对象.对于有必要将基本类型作为对象 ...
- Spark Streaming之旅
1. 打开spark-shell 2. 建立StreamingContext import org.apache.spark.streaming._ import org.apache.spark.s ...
- Android--JUnit单元测试
Android--JUnit单元测试 前言 本篇博客说明一下在Android开发中,如何使用JUnit进行单元测试.首先来了解一下什么是JUnit,JUnit测试是白盒测试,即主要是程序员自己对开 ...
- fifo write
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types. ...
- poj2253
此题略坑,%.3lf用g++一直WA,c++过的 //Accepted 468 KB 16 ms #include <cstdio> #include <cstring> #i ...
- js 网站顶部导航栏
(function(){ var map = { 'index' : 0, 'gift_code' : 1, 'base_info' : 1, 'band_phone': 1, 'unlink_pho ...
- javascript 中的 delete
那么,为什么我们能删除一个对象的属性: var x = { a: 1 }; delete x.a; // true x.a; // undefined 但却不能删除一个变量: var x = 1; d ...