3. type=range,索引范围扫描,常见于<、<=、>、>=、between等操作:
- mysql> explain select * from payment where customer_id >= 300 and customer_id <= 350 \G
- *************************** 1. row ***************************
- id: 1
- select_type: SIMPLE
- table: payment
- partitions: NULL
- type: range
- possible_keys: idx_fk_customer_id
- key: idx_fk_customer_id
- key_len: 2
- ref: NULL
- rows: 1350
- filtered: 100.00
- Extra: Using index condition
- 1 row in set, 1 warning (0.07 sec)
- mysql> explain select * from payment where customer_id = 350 \G
- *************************** 1. row ***************************
- id: 1
- select_type: SIMPLE
- table: payment
- partitions: NULL
- type: ref
- possible_keys: idx_fk_customer_id
- key: idx_fk_customer_id
- key_len: 2
推荐阅读
远胜微软谷歌等翻译器 | 基于神经网络和超级计算机的DeepL Translator
Microsoft Translator是微软旗下的翻译对象,痊愈客岁成功切换至神经网路。当时,微软表示比拟较今朝行业内主流的统计机械翻译(SMT)技巧,神经收集架构可以或许大年夜幅晋升翻译质量。德>>>详细阅读
本文标题:优化SQL语句的一般步骤
地址:http://www.17bianji.com/lsqh/37055.html
1/2 1