[improvement](statistics) Configure scanner concurrency for statistics SQL #70938
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 379 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.355
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #70938"
general
weight: 0.35
morrySnow
Background
Manual and automatic statistics collection run SQL in a dedicated FE connection context. This context starts with the global session defaults and then applies statistics-specific resource settings for SQL memory and pipeline instances. The BE has separate scanner concurrency settings for table scans and file scans.
What problem does this PR solve?
Issue Number: None
Related PR: None
PR Type: Enhancement
Problem Summary:
Operators who need to reduce scanner concurrency for statistics collection currently have to lower the corresponding global session defaults, which also affect ordinary queries. Two separate FE settings let administrators tune statistics SQL at runtime for Doris tables and file scans. Both default to one scanner per scan instance. Set either to zero to restore inheritance from the corresponding global session variable.
Details
statistics_sql_max_scanners_concurrencyapplies to ordinary scan operators such as OLAP table scans.statistics_sql_max_file_scanners_concurrencyapplies to file scan operators. Both default to1and accept values from0through256. Set either to0to inherit its global session default. They can be changed on a running FE and take effect for newly created statistics query contexts.4for ordinary scans and16for file scans. After upgrade, statistics SQL defaults to one scanner per scan instance. Set the associated FE setting to0to retain the previous inheritance behavior. Ordinary query sessions continue to obtain values from the existing session variables.Testing
ConfigTest,StatisticsUtilTest, andSessionVariableParallelismTestpassed locally (36 FE unit tests). They cover the default of one, independent overrides, inheritance, and invalid settings at runtime and startup.Notes for Reviewers
Both overrides are applied in the context builder already used by statistics SQL, alongside its execution-instance and memory settings. The startup validator runs after both FE configuration files are read and uses the same range check as dynamic config updates. The limit matches the existing query session limit.
Release note
Statistics collection now defaults to one scanner per scan instance for Doris tables and file-backed external tables. The two limits can be configured independently. Set either limit to zero to inherit the corresponding global session default.
Check List (For Author)