not in改写为anti join或not exists explain select from t1 where not exists( select 1 from t2 where t1.f2t2.f2); QUERY PLAN Remote Subquery Scan on all (dn01,dn02,dn03,dn04,dn05,dn06,dn07,dn08,dn09,dn10) (cost3865.00..4078.75 rows1 width367) > Hash Anti Join (cost3865.00..4078.75 rows1 width367) Hash Cond: (t1.f2 t2.f2) > Remote Subquery Scan on all (dn01,dn02,dn03,dn04,dn05,dn06,dn07,dn08,dn09,dn10) (cost100.00..682.00 rows1000 width367) Distribute results by S: f2 > Seq Scan on t1 (cost0.00..210.00 rows1000 width367) > Hash (cost5240.00..5240.00 rows50000 width33) > Remote Subquery Scan on all (dn01,dn02,dn03,dn04,dn05,dn06,dn07,dn08,dn09,dn10) (cost100.00..5240.00 rows50000 width33) Distribute results by S: f2 > Seq Scan on t2 (cost0.00..3240.00 rows50000 width33) (10 rows) Time: 0.974 ms teledb select from t1 where not exists( select 1 from t2 where t1.f2t2.f2); f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 +++++++++++ (0 rows) Time: 42.944 ms 可以看到改写为not exists后效果也很好。