蔡香满屋
站在牛顿头上吃苹果

not in 和not exists(sql 不返回结果集为真)

如果查询语句使用了not in 那么内外表都进行全表扫描,没有用到索引;
而not extsts 的子查询依然能用到表上的索引。
所以无论哪个表大,用not exists都比not in要快。

posted on 2018-08-28 14:22  蔡香满屋  阅读(4092)  评论(0)    收藏  举报