nest loop

最近更新时间: 2025-02-18 16:02:00

  • 复制
    复制成功
postgres=# explain select * from t1,t2 where t1.f1=t2.f1 and t2.f2=1;
                                   QUERY PLAN                                    
---------------------------------------------------------------------------------
 Remote Fast Query Execution  (cost=0.00..0.00 rows=0 width=0)
   Node/s: dn001, dn002
   ->  Nested Loop  (cost=0.70..8.75 rows=1 width=45)
         ->  Index Scan using t2_f2_idx on t2  (cost=0.28..4.30 rows=1 width=8)
               Index Cond: (f2 = 1)
         ->  Index Scan using tf_f1_idx on t1  (cost=0.42..4.44 rows=1 width=37)
               Index Cond: (f1 = t2.f1)
(7 rows)
postgres=#

注意:

驱动表要小表。