yujun777 opened a new pull request, #70938:
URL: https://github.com/apache/doris/pull/70938

   ### 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
   
   - **Before and after:** Statistics SQL previously inherited both scanner 
settings. A positive FE setting now overrides the corresponding value in the 
internal statistics query options.
   - **Configs and defaults:** `statistics_sql_max_scanners_concurrency` 
applies to ordinary scan operators such as OLAP table scans. 
`statistics_sql_max_file_scanners_concurrency` applies to file scan operators. 
Both default to `1` and accept values from `0` through `256`. Set either to `0` 
to inherit its global session default. They can be changed on a running FE and 
take effect for newly created statistics query contexts.
   - **Impact on existing users:** Built-in inherited defaults on the base 
revision are `4` for ordinary scans and `16` for file scans. After upgrade, 
statistics SQL defaults to one scanner per scan instance. Set the associated FE 
setting to `0` to retain the previous inheritance behavior. Ordinary query 
sessions continue to obtain values from the existing session variables.
   
   ### Testing
   
   - `ConfigTest`, `StatisticsUtilTest`, and `SessionVariableParallelismTest` 
passed 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)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: Yes (document both settings in the FE 
configuration and statistics collection guides)
   - Pre-submission status: Partially verified: FE build, style and focused 
tests passed. BE scanner counts were not measured on a cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to