s
Size: a a a
s
kp
N
s
s
N
s
2_
KK
s
KK
s
s
N
test=# explain select from j1 left join j2 using (i) where j2.i is null and j1.i < 100;
QUERY PLAN
--------------------------------------------------------------------------------
Nested Loop Anti Join (cost=0.85..851.60 rows=51 width=0)
-> Index Only Scan using j1_pkey on j1 (cost=0.42..10.21 rows=102 width=4)
Index Cond: (i < 100)
-> Index Only Scan using j2_pkey on j2 (cost=0.42..8.24 rows=1 width=4)
Index Cond: (i = j1.i)
(5 rows)
s
test=# explain select from j1 left join j2 using (i) where j2.i is null and j1.i < 100;
QUERY PLAN
--------------------------------------------------------------------------------
Nested Loop Anti Join (cost=0.85..851.60 rows=51 width=0)
-> Index Only Scan using j1_pkey on j1 (cost=0.42..10.21 rows=102 width=4)
Index Cond: (i < 100)
-> Index Only Scan using j2_pkey on j2 (cost=0.42..8.24 rows=1 width=4)
Index Cond: (i = j1.i)
(5 rows)
N
test=# explain select from j1 where not exists (select from j2 where j2.i = j1.i) and j1.i < 100;
QUERY PLAN
--------------------------------------------------------------------------------
Nested Loop Anti Join (cost=0.85..851.60 rows=51 width=0)
-> Index Only Scan using j1_pkey on j1 (cost=0.42..10.21 rows=102 width=4)
Index Cond: (i < 100)
-> Index Only Scan using j2_pkey on j2 (cost=0.42..8.24 rows=1 width=4)
Index Cond: (i = j1.i)
(5 rows)
N
N
s
2_