2011-08-24 57 views
2

慢查詢我增加了以下內容的my.ini記錄在MySQL

log_slow_queries = "C:\Program Files (x86)\MySQL\MySQL Server 5.0\mysql-slow.log" 
long_query_time = 3 
log-queries-not-using-indexes 

我重新啓動MySQL服務。緩慢的查詢被列在mysql-slow.log中,但問題是所有查詢都被列出。我想只列出那些需要超過3秒

以下是mysql-slow.log摘錄查詢:0我想只有那些需要3秒以上的查詢

# Query_time: 0 Lock_time: 0 Rows_sent: 29 Rows_examined: 29 
SHOW TABLES LIKE 'tblRaw2%'; 

這裏Query_time上市。 如果有任何更多的領域中的my.ini進行設置,請指出

感謝

+0

節目表命令,MySQL內部可能會將此視爲不使用索引的查詢,您是否有上述其他示例? – ajreal

+0

是的..它也適用於特定的表格。例如,我有一個名爲tblRaw20110823的表,如果我'從tblRaw20110823中選擇*'它會被列出Query_time:0 – Anuj

回答

3

您的數據庫可能沒有indexes,你已經定義:

log-queries-not-using-indexes應該被記錄下來。

刪除log-queries-not-using-indexes並重試。