Skip to content

Commit

Permalink
Consider table size when choosing join distribution type
Browse files Browse the repository at this point in the history
Cherry-pick of trinodb/trino#5141
Cherry-pick of trinodb/trino#11584

Co-authored-by: sopel39 <karol.sobczak@karolsobczak.com>
Co-authored-by: Raunaq Morarka <raunaqmorarka@gmail.com>
  • Loading branch information
3 people committed Jun 17, 2022
1 parent 039c107 commit da4f2b5
Show file tree
Hide file tree
Showing 20 changed files with 1,071 additions and 279 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_item_sk_1])
join (INNER, PARTITIONED):
remote exchange (REPARTITION, HASH, [i_brand_id_8, i_category_id_12, i_class_id_10])
scan item
final aggregation over (expr_216, expr_217, expr_218)
local exchange (GATHER, SINGLE, [])
local exchange (REPARTITION, HASH, [expr_216, expr_217, expr_218])
remote exchange (REPARTITION, HASH, [i_brand_id_53, i_category_id_57, i_class_id_55])
partial aggregation over (i_brand_id_53, i_category_id_57, i_class_id_55)
join (INNER, REPLICATED):
Expand Down Expand Up @@ -61,6 +59,9 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_brand_id_8, i_category_id_12, i_class_id_10])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
final aggregation over ()
Expand Down Expand Up @@ -103,10 +104,8 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_item_sk_552])
join (INNER, PARTITIONED):
remote exchange (REPARTITION, HASH, [i_brand_id_559, i_category_id_563, i_class_id_561])
scan item
final aggregation over (expr_836, expr_837, expr_838)
local exchange (GATHER, SINGLE, [])
local exchange (REPARTITION, HASH, [expr_836, expr_837, expr_838])
remote exchange (REPARTITION, HASH, [i_brand_id_604, i_category_id_608, i_class_id_606])
partial aggregation over (i_brand_id_604, i_category_id_608, i_class_id_606)
join (INNER, REPLICATED):
Expand Down Expand Up @@ -140,6 +139,9 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_brand_id_559, i_category_id_563, i_class_id_561])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
final aggregation over ()
Expand Down Expand Up @@ -182,10 +184,8 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_item_sk_1179])
join (INNER, PARTITIONED):
remote exchange (REPARTITION, HASH, [i_brand_id_1186, i_category_id_1190, i_class_id_1188])
scan item
final aggregation over (expr_1463, expr_1464, expr_1465)
local exchange (GATHER, SINGLE, [])
local exchange (REPARTITION, HASH, [expr_1463, expr_1464, expr_1465])
remote exchange (REPARTITION, HASH, [i_brand_id_1231, i_category_id_1235, i_class_id_1233])
partial aggregation over (i_brand_id_1231, i_category_id_1235, i_class_id_1233)
join (INNER, REPLICATED):
Expand Down Expand Up @@ -219,6 +219,9 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_brand_id_1186, i_category_id_1190, i_class_id_1188])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
final aggregation over ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_item_sk_1])
join (INNER, PARTITIONED):
remote exchange (REPARTITION, HASH, [i_brand_id_8, i_category_id_12, i_class_id_10])
scan item
final aggregation over (expr_216, expr_217, expr_218)
local exchange (GATHER, SINGLE, [])
local exchange (REPARTITION, HASH, [expr_216, expr_217, expr_218])
remote exchange (REPARTITION, HASH, [i_brand_id_53, i_category_id_57, i_class_id_55])
partial aggregation over (i_brand_id_53, i_category_id_57, i_class_id_55)
join (INNER, REPLICATED):
Expand Down Expand Up @@ -58,6 +56,9 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_brand_id_8, i_category_id_12, i_class_id_10])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
local exchange (GATHER, SINGLE, [])
Expand Down Expand Up @@ -106,10 +107,8 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_item_sk_578])
join (INNER, PARTITIONED):
remote exchange (REPARTITION, HASH, [i_brand_id_585, i_category_id_589, i_class_id_587])
scan item
final aggregation over (expr_862, expr_863, expr_864)
local exchange (GATHER, SINGLE, [])
local exchange (REPARTITION, HASH, [expr_862, expr_863, expr_864])
remote exchange (REPARTITION, HASH, [i_brand_id_630, i_category_id_634, i_class_id_632])
partial aggregation over (i_brand_id_630, i_category_id_634, i_class_id_632)
join (INNER, REPLICATED):
Expand Down Expand Up @@ -143,6 +142,9 @@ local exchange (GATHER, SINGLE, [])
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [i_brand_id_585, i_category_id_589, i_class_id_587])
scan item
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
local exchange (GATHER, SINGLE, [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@ final aggregation over ()
local exchange (GATHER, SINGLE, [])
remote exchange (GATHER, SINGLE, [])
partial aggregation over ()
join (LEFT, PARTITIONED):
final aggregation over (ca_state, cc_county, cs_call_center_sk, cs_ext_ship_cost, cs_net_profit, cs_order_number, cs_ship_addr_sk, cs_ship_date_sk, cs_warehouse_sk, d_date, unique)
local exchange (GATHER, SINGLE, [])
partial aggregation over (ca_state, cc_county, cs_call_center_sk, cs_ext_ship_cost, cs_net_profit, cs_order_number, cs_ship_addr_sk, cs_ship_date_sk, cs_warehouse_sk, d_date, unique)
join (RIGHT, PARTITIONED):
remote exchange (REPARTITION, HASH, [cs_order_number_17])
scan catalog_sales
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [cs_order_number])
join (INNER, REPLICATED):
local exchange (GATHER, SINGLE, [])
join (RIGHT, PARTITIONED):
final aggregation over (cr_order_number)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [cr_order_number])
partial aggregation over (cr_order_number)
scan catalog_returns
final aggregation over (ca_state, cc_county, cs_call_center_sk, cs_ext_ship_cost, cs_net_profit, cs_order_number, cs_ship_addr_sk, cs_ship_date_sk, cs_warehouse_sk, d_date, unique)
local exchange (GATHER, SINGLE, [])
partial aggregation over (ca_state, cc_county, cs_call_center_sk, cs_ext_ship_cost, cs_net_profit, cs_order_number, cs_ship_addr_sk, cs_ship_date_sk, cs_warehouse_sk, d_date, unique)
join (RIGHT, PARTITIONED):
remote exchange (REPARTITION, HASH, [cs_order_number_17])
scan catalog_sales
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [cs_order_number])
join (INNER, REPLICATED):
join (INNER, REPLICATED):
scan catalog_sales
join (INNER, REPLICATED):
scan catalog_sales
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan customer_address
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan customer_address
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan call_center
final aggregation over (cr_order_number)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [cr_order_number])
partial aggregation over (cr_order_number)
scan catalog_returns
scan call_center
Loading

0 comments on commit da4f2b5

Please sign in to comment.