回表问题
来源:3-7 密集索引和稀疏索引的区别
湿地车手
2021-12-02
老师,是不是如果直接通过主键查询就不需要回表了
比如select * from table where id = xxx;这个就不需要回表(id为主键),假如对A列建立索引,select * from table where A = xxx;是需要回表的。select A from table where A = xxx;或者select id, A from table where A = xxx;是不需要回表的。
写回答
1回答
-
翔仔
2021-12-02
同学好,直接Explain一下就知道了,这个不好说,得依赖于当时的数据体量,mysql解析器会自行判断的
00
相似问题