Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[feat](stats) Support analyze with sample automatically#23978
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
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
32 changes: 30 additions & 2 deletions
32 fe/fe-common/src/main/java/org/apache/doris/common/Config.java
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 |
|---|---|---|
| @@ -17,6 +17,8 @@ | ||
| package org.apache.doris.common; | ||
| import java.util.concurrent.TimeUnit; | ||
| public class Config extends ConfigBase { | ||
| @ConfField(description = {"用户自定义配置文件的路径,用于存放 fe_custom.conf。该文件中的配置会覆盖 fe.conf 中的配置", | ||
| @@ -1516,8 +1518,12 @@ public class Config extends ConfigBase { | ||
| /* | ||
| * the system automatically checks the time interval for statistics | ||
| */ | ||
| @ConfField(mutable = true, masterOnly = true) | ||
| public static int auto_check_statistics_in_minutes = 1; | ||
| @ConfField(mutable = true, masterOnly = true, description = { | ||
| "该参数控制自动收集作业检查库表统计信息健康度并触发自动收集的时间间隔", | ||
| "This parameter controls the time interval for automatic collection jobs to check the health of table" | ||
| + "statistics and trigger automatic collection" | ||
| }) | ||
| public static int auto_check_statistics_in_minutes = 10; | ||
| /** | ||
| * If this configuration is enabled, you should also specify the trace_export_url. | ||
| @@ -2172,4 +2178,26 @@ public class Config extends ConfigBase { | ||
| + "The larger the value, the more uniform the distribution of the hash algorithm, " | ||
| + "but it will increase the memory overhead."}) | ||
| public static int virtual_node_number = 2048; | ||
| @ConfField(description = {"控制对大表的自动ANALYZE的最小时间间隔," | ||
| + "在该时间间隔内大小超过huge_table_lower_bound_size_in_bytes的表仅ANALYZE一次", | ||
| "This controls the minimum time interval for automatic ANALYZE on large tables. Within this interval," | ||
| + "tables larger than huge_table_lower_bound_size_in_bytes are analyzed only once."}) | ||
| public static long huge_table_auto_analyze_interval_in_millis = TimeUnit.HOURS.toMillis(12); | ||
| @ConfField(description = {"定义大表的大小下界,在开启enable_auto_sample的情况下," | ||
| + "大小超过该值的表将会自动通过采样收集统计信息", "This defines the lower size bound for large tables. " | ||
| + "When enable_auto_sample is enabled, tables larger than this value will automatically collect " | ||
| + "statistics through sampling"}) | ||
| public static long huge_table_lower_bound_size_in_bytes = 5L * 1024 * 1024 * 1024; | ||
morningman marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| @ConfField(description = {"定义开启开启大表自动sample后,对大表的采样行数", | ||
| "This defines the number of sample rows for large tables when automatic sampling for" | ||
| + "large tables is enabled"}) | ||
| public static int huge_table_default_sample_rows = 20_0000; | ||
| @ConfField(description = {"是否开启大表自动sample,开启后对于大小超过huge_table_lower_bound_size_in_bytes会自动通过采样收集" | ||
| + "统计信息", "Whether to enable automatic sampling for large tables, which, when enabled, automatically" | ||
| + "collects statistics through sampling for tables larger than 'huge_table_lower_bound_size_in_bytes'"}) | ||
| public static boolean enable_auto_sample = false; | ||
| } | ||
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
8 changes: 8 additions & 0 deletions
8 fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyzeProperties.java
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
4 changes: 4 additions & 0 deletions
4 fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyzeStmt.java
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
3 changes: 3 additions & 0 deletions
3 fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyzeTblStmt.java
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
2 changes: 1 addition & 1 deletion
2 fe/fe-core/src/main/java/org/apache/doris/analysis/ShowTableStatsStmt.java
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
39 changes: 27 additions & 12 deletions
39 fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java
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
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
8 changes: 7 additions & 1 deletion
8 fe/fe-core/src/main/java/org/apache/doris/catalog/TableIf.java
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
6 changes: 4 additions & 2 deletions
6 fe/fe-core/src/main/java/org/apache/doris/catalog/external/ExternalTable.java
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
19 changes: 14 additions & 5 deletions
19 fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisInfo.java
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
36 changes: 8 additions & 28 deletions
36 fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisInfoBuilder.java
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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.