explain (verbose on, nodes off, costs off) select * from tab1_mod natural join tab1_rep
where tab1_mod.val > 2 and tab1_rep.val < 4;
- QUERY PLAN
------------------------------------------------------------------------------------------
- Remote Subquery Scan on all
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------------
+ Remote Fast Query Execution
Output: tab1_mod.val, tab1_mod.val2
+ Remote query: SELECT tab1_mod.val, tab1_mod.val2 FROM (tab1_mod JOIN tab1_rep USING (val, val2)) WHERE ((tab1_mod.val > 2) AND (tab1_rep.val < 4))
-> Merge Join
Output: tab1_mod.val, tab1_mod.val2
Merge Cond: ((tab1_mod.val = tab1_rep.val) AND (tab1_mod.val2 = tab1_rep.val2))
-> Seq Scan on public.tab1_rep
Output: tab1_rep.val, tab1_rep.val2
Filter: (tab1_rep.val < 4)
-(17 rows)
+(18 rows)
-- Join involving one distributed and one replicated table, with replicated
-- table existing on only some of the nodes where distributed table exists.
explain (verbose on, nodes off, costs off) select * from tab2_rep natural join tab4_rep natural join tab2_mod
where tab2_rep.val > 2 and tab4_rep.val < 4;
- QUERY PLAN
------------------------------------------------------------------------------------------------------
- Remote Subquery Scan on all
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Remote Fast Query Execution
Output: tab2_rep.val, tab2_rep.val2
+ Remote query: SELECT tab2_rep.val, tab2_rep.val2 FROM ((tab2_rep JOIN tab4_rep USING (val, val2)) JOIN tab2_mod USING (val, val2)) WHERE ((tab2_rep.val > 2) AND (tab4_rep.val < 4))
-> Hash Join
Output: tab2_rep.val, tab2_rep.val2
Hash Cond: ((tab2_mod.val = tab2_rep.val) AND (tab2_mod.val2 = tab2_rep.val2))
-> Seq Scan on public.tab4_rep
Output: tab4_rep.val, tab4_rep.val2
Filter: (tab4_rep.val < 4)
-(24 rows)
+(25 rows)
select * from tab4_rep natural join tab2_rep natural join tab2_mod
where tab2_rep.val > 2 and tab4_rep.val < 4;
explain (verbose on, nodes off, costs off) select * from tab4_rep natural join tab2_rep natural join tab2_mod
where tab2_rep.val > 2 and tab4_rep.val < 4;
- QUERY PLAN
------------------------------------------------------------------------------------------------------
- Remote Subquery Scan on all
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Remote Fast Query Execution
Output: tab4_rep.val, tab4_rep.val2
+ Remote query: SELECT tab4_rep.val, tab4_rep.val2 FROM ((tab4_rep JOIN tab2_rep USING (val, val2)) JOIN tab2_mod USING (val, val2)) WHERE ((tab2_rep.val > 2) AND (tab4_rep.val < 4))
-> Hash Join
Output: tab4_rep.val, tab4_rep.val2
Hash Cond: ((tab2_mod.val = tab4_rep.val) AND (tab2_mod.val2 = tab4_rep.val2))
-> Seq Scan on public.tab2_rep
Output: tab2_rep.val, tab2_rep.val2
Filter: (tab2_rep.val > 2)
-(24 rows)
+(25 rows)
select * from tab2_rep natural join tab2_mod natural join tab4_rep
where tab2_rep.val > 2 and tab4_rep.val < 4;