新問題
- 優(yōu)化器中的type精講
知識點
- 效率從低到高:
- all<index<range<ref<eq_ref<const,system < null
- 具體字段含義:
- all: 全盤掃描档冬,不走索引;
- index: 按索引次序全索引掃描爸业;
- ref: 索引直接獲取單個數(shù)據(jù)斑举;
- const: 通過主鍵直接返回數(shù)據(jù)睡陪;
- null: 不操作效率最快渤愁;
上手操作
use world;
select * from city;
select countrycode from city;
select * from city where id<10;
select * from city where id=1;
課程視頻
mysql_coldknowlegde_lesson12on bilibili
mysql_coldknowlegde_lesson12on xigua