-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat(optimizer): Add exchange on table scan when number of files to be scanned is small #26941
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -327,6 +327,8 @@ public class FeaturesConfig | |
| private long maxSerializableObjectSize = 1000; | ||
| private boolean utilizeUniquePropertyInQueryPlanning = true; | ||
| private String expressionOptimizerUsedInRowExpressionRewrite = ""; | ||
| private double tableScanShuffleParallelismThreshold = 0.1; | ||
| private ShuffleForTableScanStrategy tableScanShuffleStrategy = ShuffleForTableScanStrategy.DISABLED; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To avoid leaving this disabled by default, I'm wondering if you considered always making it cost based, but set a default estimate if not provided to 1, which would effectively leave the optimization disabled until connectors modify their code to provide a better estimate? Please also add documentation for these session properties and config properties.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer to keep it more explicit, and it's also consistent with other existing optimization config. Added documentation in the corresponding rst files. |
||
|
|
||
| private boolean builtInSidecarFunctionsEnabled; | ||
|
|
||
|
|
@@ -485,6 +487,13 @@ public enum LeftJoinArrayContainsToInnerJoinStrategy | |
| ALWAYS_ENABLED | ||
| } | ||
|
|
||
| public enum ShuffleForTableScanStrategy | ||
| { | ||
| DISABLED, | ||
| ALWAYS_ENABLED, | ||
| COST_BASED | ||
| } | ||
|
|
||
| @Min(1) | ||
| @Config("max-prefixes-count") | ||
| @ConfigDescription("Maximum number of prefixes (catalog/schema/table scopes used to narrow metadata lookups) that Presto generates when querying information_schema.") | ||
|
|
@@ -3298,6 +3307,32 @@ public long getMaxSerializableObjectSize() | |
| return maxSerializableObjectSize; | ||
| } | ||
|
|
||
| public double getTableScanShuffleParallelismThreshold() | ||
| { | ||
| return tableScanShuffleParallelismThreshold; | ||
| } | ||
|
|
||
| @Config("optimizer.table-scan-shuffle-parallelism-threshold") | ||
| @ConfigDescription("Parallelism threshold for adding a shuffle above table scan. When the table's parallelism factor is below this threshold (0.0-1.0) and TABLE_SCAN_SHUFFLE_STRATEGY is COST_BASED, a round-robin shuffle exchange is added above the table scan to redistribute data.") | ||
| public FeaturesConfig setTableScanShuffleParallelismThreshold(double tableScanShuffleParallelismThreshold) | ||
| { | ||
| this.tableScanShuffleParallelismThreshold = tableScanShuffleParallelismThreshold; | ||
| return this; | ||
| } | ||
|
|
||
| public ShuffleForTableScanStrategy getTableScanShuffleStrategy() | ||
| { | ||
| return tableScanShuffleStrategy; | ||
| } | ||
|
|
||
| @Config("optimizer.table-scan-shuffle-strategy") | ||
| @ConfigDescription("Strategy for adding shuffle above table scan to redistribute data. Options are DISABLED, ALWAYS_ENABLED, COST_BASED") | ||
| public FeaturesConfig setTableScanShuffleStrategy(ShuffleForTableScanStrategy tableScanShuffleStrategy) | ||
| { | ||
| this.tableScanShuffleStrategy = tableScanShuffleStrategy; | ||
| return this; | ||
| } | ||
|
|
||
| @Config("built-in-sidecar-functions-enabled") | ||
| @ConfigDescription("Enable using CPP functions from sidecar over coordinator SQL implementations.") | ||
| public FeaturesConfig setBuiltInSidecarFunctionsEnabled(boolean builtInSidecarFunctionsEnabled) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.