如果我正在访问的字段是复合索引的一部分,我是否仍能从仅引用其中一个字段的索引中受益?

If a field I'm accessing is part of a compound index do I still get the benefits of that index just referencing one of the fields?

在 MySQL 中,我有一个关于 2 个字段 (a,b) 的复合索引。如果我只访问字段 a 作为查询的一部分,我仍然可以获得索引的好处吗?

谢谢

想想电话簿。它基本上是 last_name、first_name.

上的排序索引

即使您仅按姓氏搜索,电话簿以这种方式排序是否有助于您查找人员?

是的,确实如此。