关于mysql聚合索引,这是有段话,一定不是很理解。
If you specify the columns in the right order in the index definition, a single composite index can speed up several kinds of queries on the same table.
关于mysql聚合索引,这是有段话,一定不是很理解。
If you specify the columns in the right order in the index definition, a single composite index can speed up several kinds of queries on the same table.
5 回答3.2k 阅读✓ 已解决
3 回答3.6k 阅读✓ 已解决
2 回答2.8k 阅读✓ 已解决
5 回答1.4k 阅读
3 回答1.2k 阅读✓ 已解决
2 回答2k 阅读
3 回答2k 阅读
我习惯用多列索引来说, 这句话就是说明建多列索引时, 要考虑各个列的顺序。
直接拿官方文档解释: 假设索引建立在 (last_name, first_name) 上, 那么
以上几种情况都是可以用这个多列索引来加速查询,这就是后半句话的意思。
但是下面这两种情况是无法使用
(last_name, first_name)
索引的,因为多列索引必须是按照左值匹配,按照建索引的字段顺序来才行,这就是前半句话的意思