聚集索引需要回表吗?

问题遇到的现象和发生背景

聚集索引的叶子节点存储数据,按道理说一个查询select* from s1 where id=123 用聚集索引是不用回表的,但是结果却是要回表

问题相关代码,请勿粘贴截图

EXPLAIN select name from s1 where id=123;

img

EXPLAIN select id from s1 where id=123;

img

查询没有索引的列都要回表吧

个人认为是因为没有加where条件 id = xx,然后mysql优化器认为select * 全表扫描比走聚集索引更高效

聚集索引是不用回表的,null又不代表它回表了