Skip to content

Commit

Permalink
Avoid planning unnecessary LIMIT/TopN/Sort/DistinctLimit when relatio…
Browse files Browse the repository at this point in the history
…n is know to single row or less rows than requested

Cherry-pick of trinodb/trino#441

Co-authored-by: praveenkrishna <praveenkrishna@tutanota.com>
  • Loading branch information
fgwang7w and Praveen2112 committed Dec 14, 2020
1 parent 4d5afce commit ccf42a8
Show file tree
Hide file tree
Showing 27 changed files with 1,247 additions and 463 deletions.
Original file line number Diff line number Diff line change
@@ -1,57 +1,56 @@
local exchange (GATHER, SINGLE, [])
remote exchange (GATHER, SINGLE, [])
final aggregation over (channel$gid, groupid, id$gid)
local exchange (REPARTITION, HASH, [channel$gid, groupid, id$gid])
remote exchange (REPARTITION, HASH, [channel$gid, groupid, id$gid])
partial aggregation over (channel$gid, groupid, id$gid)
local exchange (REPARTITION, ROUND_ROBIN, [])
final aggregation over (s_store_id)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [s_store_id])
partial aggregation over (s_store_id)
remote exchange (GATHER, SINGLE, [])
final aggregation over (channel$gid, groupid, id$gid)
local exchange (REPARTITION, HASH, [channel$gid, groupid, id$gid])
remote exchange (REPARTITION, HASH, [channel$gid, groupid, id$gid])
partial aggregation over (channel$gid, groupid, id$gid)
local exchange (REPARTITION, ROUND_ROBIN, [])
final aggregation over (s_store_id)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [s_store_id])
partial aggregation over (s_store_id)
join (INNER, REPLICATED):
join (INNER, REPLICATED):
join (INNER, REPLICATED):
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan store_sales
scan store_returns
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan date_dim
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan store_sales
scan store_returns
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan store
final aggregation over (cp_catalog_page_id)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [cp_catalog_page_id])
partial aggregation over (cp_catalog_page_id)
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan store
final aggregation over (cp_catalog_page_id)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [cp_catalog_page_id])
partial aggregation over (cp_catalog_page_id)
join (INNER, REPLICATED):
join (INNER, REPLICATED):
join (INNER, REPLICATED):
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan catalog_sales
scan catalog_returns
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan date_dim
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan catalog_sales
scan catalog_returns
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan catalog_page
final aggregation over (web_site_id)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [web_site_id])
partial aggregation over (web_site_id)
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan catalog_page
final aggregation over (web_site_id)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [web_site_id])
partial aggregation over (web_site_id)
join (INNER, REPLICATED):
join (INNER, REPLICATED):
join (INNER, REPLICATED):
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan web_sales
join (RIGHT, PARTITIONED):
remote exchange (REPARTITION, HASH, [ws_item_sk_216, ws_order_number_230])
scan web_sales
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [wr_item_sk, wr_order_number])
scan web_returns
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan date_dim
remote exchange (REPARTITION, ROUND_ROBIN, [])
scan web_sales
join (RIGHT, PARTITIONED):
remote exchange (REPARTITION, HASH, [ws_item_sk_216, ws_order_number_230])
scan web_sales
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, [wr_item_sk, wr_order_number])
scan web_returns
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan web_site
scan date_dim
local exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan web_site
Loading

0 comments on commit ccf42a8

Please sign in to comment.