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

相关文章
相关标签/搜索