首先,我是優化mysql的新手。事實是,我在我的Web應用程序中(每秒約400個查詢),使用我無法避免的GROUP BY
的查詢,這是創建臨時表的原因。我的配置是:最佳的MySQL臨時表(內存表)配置?
max_heap_table_size = 16M
tmp_table_size = 32M
結果:臨時表到磁盤%的+ - 12.5%
然後,我改變了我的設置,根據this post
max_heap_table_size = 128M
tmp_table_size = 128M
結果:臨時表到磁盤百分比+ - 18%
結果沒有預料,不明白爲什麼。
這是錯的tmp_table_size = max_heap_table_size
? 不應該增加大小?
查詢
SELECT images, id
FROM classifieds_ads
WHERE parent_category = '1' AND published='1' AND outdated='0'
GROUP BY aux_order
ORDER BY date_lastmodified DESC
LIMIT 0, 100;
EXPLAIN
| 1 |SIMPLE|classifieds_ads | ref |parent_category, published, combined_parent_oudated_published, oudated | combined_parent_oudated_published | 7 | const,const,const | 67552 | Using where; Using temporary; Using filesort |
不需要道歉 - 你的英語很好。 – 2010-07-09 17:48:51
同意OMG小馬;我們希望在英語不太好的情況下,不會有人提問。 – 2010-07-09 18:19:06
你的書面英語比我一起工作的英國本土同事更好! :) – 2010-07-09 18:48:38