-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Remove Limit/TopN/Sort/DistinctLimit node if it's source is a scalar #441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kokosing
merged 6 commits into
trinodb:master
from
Praveen2112:scalar_query_simplification
May 17, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4dab17e
Use Upper case for SQL keywords
Praveen2112 1a6d633
Optimize import
Praveen2112 30af094
Prune LimitNode when source cardinality is less than LimitNode count
Praveen2112 6105683
Remove Sort node when it is applied on a single row
Praveen2112 011e1df
Prune unnecessary TopNNode
Praveen2112 f2b806b
Prune unnecessary DistinctLimitNode
Praveen2112 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
95 changes: 47 additions & 48 deletions
95
presto-benchto-benchmarks/src/test/resources/sql/presto/tpcds/q05.plan.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local exchange was removed, this is nice