select count(*) from t_table1 as t1 where (或 not) exists (select null from t_table2 as t2 where t2.user_id = t1.user_id)
同样的条件,同样2500万条记录。
为什么mssql,1秒就出结果了
而 postgresql 要 120 才出结果?
...全文
5852打赏收藏
postgresql 为什么这么慢
select count(*) from t_table1 as t1 where (或 not) exists (select null from t_table2 as t2 where t2.user_id = t1.user_id) 同样的条件,同样2500万条记录。 为什么mssql,1秒就出结果了 而 postgresql 要 120 才出结果?