朋友找我帮忙看下数据库,说想对一些查询做些优化。
说是临时表创建比较多,但不知道是具体哪些查询出现问题。
想问下有没有办法仅记录出使用某种方式的查询这种功能or工具,遂来请教一下。谢谢
tuning-primer.sh:
TEMP TABLES
Current max_heap_table_size = 256 M
Current tmp_table_size = 256 M
Of 62452 temp tables, 36% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.
mysqltuner.pl:
[!!] Temporary tables created on disk: 57% (35K on disk / 62K total)
临时表存储在/dev/shm上,没有慢查询目前,就是看着上面的数据有些不爽。。。