小编n00*_*00b的帖子

索引是否需要覆盖所有选定的列?

我正在使用带有非常基本查询的 AWS Aurora 数据库(MySQL 引擎):

SELECT * FROM phones_table where phone_number = 98371381;
Run Code Online (Sandbox Code Playgroud)

phone_number列上的该表有一个索引:

mysql> show index from vaya_call_data_record;
+--------------+------------+--------------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table        | Non_unique | Key_name                       | Seq_in_index | Column_name    | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+--------------+------------+--------------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| phones_table |          0 | PRIMARY                        |            1 | id             | A         |     4415670 |     NULL | NULL   |      | BTREE      |         |               |
| phones_table |          1 | idx_phones_table_phone_number …
Run Code Online (Sandbox Code Playgroud)

mysql index

1
推荐指数
1
解决办法
90
查看次数

标签 统计

index ×1

mysql ×1