mysql 索引優化、聯合索引(有效索引)

以下圖爲多索引,有聯合索引blog

 

 

timestamp 和 txid 作爲單個關鍵字段查詢有效。索引

timestamp 和 txid 聯合查詢時,則聯合索引 txid, timestamp, input_total 有效。input

 

聯合索引居左有效im

舉例 txid, timestamp, input_total查詢

當查詢(txid, timestamp, input_total)、(txid, timestamp)、(txid)時該聯合索引有效img

當查詢(timestamp, input_total)、(txid, input_total)、(timestamp)、(input_total)時該聯合索引無效co

相關文章
相關標籤/搜索