如何优化mysql not in :
语句:
select A.* from A where A.id not in (
select B.aid from B where B.id !=1
)
not exists
1 and < 1
虽然现在计算机硬件及网络设备都比以前大大提高,但查询优化也是我们要追求的,尤其在大的庞大的数据量下。 在sql查询中,not in 需要全集检索,很影响性能。 为了提高查询性能,我们可以用 连接 替代not in 如下: select a,b,c from A where a not in (select a from B); 可以替换为 select a,......
答案就在这里:性能优化---替代not in
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。
机器人好聪明啊 告诉你左连接替代not