dev=> explain create materialized view mv3 as select * from orders join customer on o_custkey = c_custkey;
QUERY PLAN
---------------------------------------------------------------------------
StreamMaterialize { columns: [o_orderkey, o_custkey, o_totalprice, o_orderdate, c_custkey, c_name, c_phone], pk_columns: [o_orderkey, c_custkey, o_custkey] }
└─StreamHashJoin { type: Inner, predicate: orders.o_custkey = customer.c_custkey }
├─StreamExchange { dist: HashShard(orders.o_custkey) }
| └─StreamTableScan { table: orders, columns: [o_orderkey, o_custkey, o_totalprice, o_orderdate] }
└─StreamExchange { dist: HashShard(customer.c_custkey) }
└─StreamTableScan { table: customer, columns: [c_custkey, c_name, c_phone] }
(6 rows)
dev=> explain (distsql) create materialized view mv3 as select * from orders join customer on o_custkey = c_custkey;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Fragment 0
StreamMaterialize { columns: [o_orderkey, o_custkey, o_totalprice, o_orderdate, c_custkey, c_name, c_phone], pk_columns: [o_orderkey, c_custkey, o_custkey] }
materialized table: 4294967294
StreamHashJoin { type: Inner, predicate: orders.o_custkey = customer.c_custkey }
left table: 0, right table 2, left degree table: 1, right degree table: 3,
StreamExchange Hash([1]) from 1
StreamExchange Hash([0]) from 2
Fragment 1
Chain { table: orders, columns: [o_orderkey, o_custkey, o_totalprice, o_orderdate] }
Upstream
BatchPlanNode
Fragment 2
Chain { table: customer, columns: [c_custkey, c_name, c_phone] }
Upstream
BatchPlanNode
Table 0 { columns: [orders_o_orderkey, orders_o_custkey, orders_o_totalprice, orders_o_orderdate], primary key: [$1 ASC, $0 ASC], value indices: [0, 1, 2, 3], distribution key: [1] }
Table 1 { columns: [orders_o_custkey, orders_o_orderkey, _degree], primary key: [$0 ASC, $1 ASC], value indices: [2], distribution key: [0] }
Table 2 { columns: [customer_c_custkey, customer_c_name, customer_c_phone], primary key: [$0 ASC], value indices: [0, 1, 2], distribution key: [0] }
Table 3 { columns: [customer_c_custkey, _degree], primary key: [$0 ASC], value indices: [1], distribution key: [0] }
Table 4294967294 { columns: [o_orderkey, o_custkey, o_totalprice, o_orderdate, c_custkey, c_name, c_phone], primary key: [$0 ASC, $4 ASC, $1 ASC], value indices: [0, 1, 2, 3, 4, 5, 6], distribution key: [1] }
(23 rows)