使用A表和B表各五万条数据做了几次测试,使用not in和not exist的性能差别不大,甚至not in 还好些。 not exists的语句如下:  select * from a where not exists(  select * from b  where b.id = a.id ) 运行时间对比: not in: 0.161s    0.160s    0.160s     0.161s     0.161s    0.187s    0.169s    0.175s    0.161s    0.171s not ex:0.176s     0.176s     0.178s    0.201s    0.259s    0.184s    0.176s    0.190s    0.177s    0.176s 所以,个人感觉使用not exists不是解决方法
点赞 评论

相关推荐

牛客热帖

牛客网
牛客企业服务