Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: auto_analyze执行的时候,会对业务造成影响,生产环境上,有没有比较好的实践配置
[TiDB Usage Environment] Production Environment
[TiDB Version] v5.4
[Reproduction Path] Trigger auto analyze
[Encountered Problem: Phenomenon and Impact]
DML blocking, slow query and insertion, causing the business system’s database connection pool to be full and slow response.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
After this issue occurs, the execution plan of the SQL shows stats:pseudo. Is it necessary to manually collect statistics for all tables to resolve it?
This means that the statistical information is inaccurate.
Sure, you can analyze it during non-peak business hours.
There is a parameter that can be turned off.
I think we can enable fast statistics collection with tidb_enable_fast_analyze
and increase the data modification threshold tidb_auto_analyze_ratio
before collecting statistics. Additionally, for those large tables, we can deploy manual tasks (during non-business hours, with small sample collection).
I encountered a similar issue with version V5.*. Has version V6 alleviated this problem? For example, is the analyze process faster and less costly?
Then just use fast analyze, but this thing isn’t that accurate.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.