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:

  1. Query processing must stop
  2. Create a temp table on disk
  3. Transfer the contents of the memory-based temp table into the disk-based temp table
  4. Drop in the memory-based temp table
  5. 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的更多相关文章

  1. 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 ...

  2. MYSQL增加tmp_table_size 的操作

    最近有张表经常损坏,修复后还是会出现损坏. dba分析有可能是临时表空间太小导致的.以下是设置临时表空间大小的操作. 设置 tmp_table_size的大小 mysql> set global ...

  3. mysql - tmp_table_size & max_heap_table_size

    Command-Line Format --tmp_table_size=# System Variable Name tmp_table_size Variable Scope Global, Se ...

  4. tmp_table_size ---> 优化 MYSQL 经验总结

    数据库连接突然增多到1000的问题 查看了一下,未有LOCK操作语句. 但是明显有好多copy to tmp table的SQL语句,这条语读的时间比较长,且这个表会被加读锁,相关表的update语句 ...

  5. [原] KVM 环境下MySQL性能对比

    KVM 环境下MySQL性能对比 标签(空格分隔): Cloud2.0 [TOC] 测试目的 对比MySQL在物理机和KVM环境下性能情况 压测标准 压测遵循单一变量原则,所有的对比都是只改变一个变量 ...

  6. 在 Windows7 上按照 MySQL5.7

    在 Windows7 上按照 MySQL5.7 1.从官网下载最新版本的 MySQL,这里下载的是 mysql-5.7.17-win32: 2.将下载的 mysql-5.7.17-win32.zip ...

  7. Mysql 中 show full processlist

    processlist命令的输出结果显示了有哪些线程在运行,可以帮助识别出有问题的查询语句,两种方式使用这个命令. 1. 进入MySQL/bin目录下输入mysqladmin processlist; ...

  8. MySQL多实例安装

    1.安装MySQL需要的依赖的包和编译软件   (1)安装MySQL需要的依赖包 安装MySQL之前,最好先安装MySQL需要的依赖包,不然后面会出现报错,还得回来安装MySQL的依赖包. [root ...

  9. MYSQL数据库的优化

    我们究竟应该如何对MySQL数据库进行优化?下面我就从MySQL对硬件的选择.MySQL的安装.my.cnf的优化.MySQL如何进行架构设计及数据切分等方面来说明这个问题. 服务器物理硬件的优化 在 ...

随机推荐

  1. 二模 (13)day2

    第一题: 题目大意: 给出一个N*M的矩阵,定义一条路径的权值为经过的所有点权值的最大值.求一条从第一行到第N行的路径,使得路径权值最小. N,M<=1000 矩阵内点的权值小于1000. 解题 ...

  2. <1 小玩意(覆盖效果)

    <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="utf-8& ...

  3. 我是一只IT小小鸟

    不知不觉中走过了高三的时光,最后也没抓住时间的尾巴,不得不承认自己已经到了大一下学期了.接触了大学生职业生涯规划这门课程,一开始认为学习了这门课程以后就会对自己的未来有一个规划,渐渐的去意识到软件工程 ...

  4. AsyncTask的基本使用和各个参数的说明

    AsyncTask 的执行分为四个步骤,每一步都对应一个回调方法,需要注意的是这些方法不应该由应用程序调用,开发者需要做的就是实现这些方法.在任务的执行过程中,这些方法被自动调用. * onPreEx ...

  5. Sql获取第一天、最后一天

    昨天面试一家公司,上机题目中要求获取每月最后一笔订单.用到了日期的选择性查询,回来在ITeye上找到了这篇文章. 原文: http://new-fighter.iteye.com/blog/17587 ...

  6. [深入Python]__new__和__init__

    class A(object): def __init__(self): print "init" def __new__(cls,*args, **kwargs): print ...

  7. TP验证

  8. webmin-1.810 安装

    Installing the tar.gz file Before downloading Webmin, you must already have Perl 5 installed on your ...

  9. js事件处理机制

    一.事件处理程序 a.     DOM0级事件处理程序,被认为是元素的方法. var btn=document.getElementById('myBtn'); btn.onclick=functio ...

  10. dpkg ---- apt-get ------ aptitude 三种方式的区别 及命令格式

    转自:http://blog.csdn.net/xiaoyanghuaban/article/details/22946987 dpkg绕过apt包管理数据库对软件包进行操作,所以你用dpkg安装过的 ...