B-tree 索引
MySQL 中能够使用索引的典型场景
SELECT title FROM film_text WHERE title LIKE 'AFRICAN%'SELECT inventory_id FROM rental WHERE rental_date = '2006-02-14 15:16:03' AND customer_id >= 300 AND customer_id <= 400;EXPLAIN SELECT * FROM rental WHERE rental_date = '2006-02-14 15:16:03' AND customer_id >= 300 AND customer_id <= 400 \G;*************************** 1. row *************************** id: 1 select_type: SIMPLE table: rental partitions: NULL type: ref possible_keys: rental_date,idx_fk_customer_id key: rental_date key_len: 5 ref: const rows: 182 filtered: 16.85 Extra: Using index condition
存在索引但不能使用索引的典型场景
查看索引使用情况
自适应 HASH 索引
索引的优点
最后更新于