matanper opened a new issue, #68895:
URL: https://github.com/apache/doris/issues/68895

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   ### Version
   
   4.1.4; master is the same.
   
   ### What's Wrong?
   
   Automatic statistics collection with sampling still runs a full, unsampled 
scan per column. `OlapAnalysisTask.doSample()` calls `collectMinMax()`, which 
runs `SELECT MIN(col), MAX(col) FROM db.tbl` (`BASIC_STATS_TEMPLATE`) with no 
`TABLESAMPLE`. On a large table with many columns, every auto-analyze cycle 
issues one full-table scan per column.
   
   On a cloud-mode table with tens of billions of rows and about 80 columns, 
under heavy ingestion, these scans:
   - read mostly uncached data, so they add a large burst of S3 GETs on top of 
ingestion. That pushed the storage prefixes into 503 SlowDown and curl 
timeouts, which also stalled concurrent loads;
   - often hit the 300 s query timeout and fail (see the related issue on 
retries).
   
   ### What You Expected?
   
   In sample mode, min/max should come from the sample (or from segment zone 
maps or rowset statistics), not from a full scan per column. At least, the full 
min/max scan should be optional for huge tables.
   
   ### How to Reproduce?
   
   Create a large table (billions of rows, many columns) in cloud mode, keep 
auto analyze enabled, and watch the FE audit log for `SELECT MIN(...), 
MAX(...)` statements issued by statistics collection, one per column per cycle.
   
   ### Anything Else?
   
   Related: a failed auto-analyze job doesn't record an analyze time, so the 
scans repeat every cycle (separate issue).
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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