Raise a question about tidb_enable_pseudo_for_outdated_stats

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb_enable_pseudo_for_outdated_stats提一个问题

| username: tidb狂热爱好者

【TiDB Usage Environment】Production
【TiDB Version】
【Encountered Problem】


【Reproduction Path】What operations were performed to encounter the problem
【Problem Phenomenon and Impact】
What will be the impact if tidb_enable_pseudo_for_outdated_stats is set to off?

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: Hi70KG | Original post link

After a table has been extensively modified (the documentation says 80%), if it is set to off, the optimizer will not recollect statistics and will still use the original statistics. This may affect the execution plans generated for subsequent operations on this table, as the information is outdated.

| username: cs58_dba | Original post link

  • The official recommendation is that if the table data is frequently modified and ANALYZE is not executed in a timely manner, but you still want the execution plan to remain stable, you can set this variable to OFF.
    系统变量 | PingCAP 文档中心
| username: tidb狂热爱好者 | Original post link

Yes, now that I have disabled it, the statistics will not expire, right?

| username: tidb狂热爱好者 | Original post link

You can import and export fixed statistics.

| username: cs58_dba | Original post link

This is the PCTP lab manual, right?

| username: 啦啦啦啦啦 | Original post link

Disabling this parameter will still cause the statistics to expire, but even if they expire, the optimizer will still use the statistics on the table instead of pseudo statistics.

| username: h5n1 | Original post link

There may be a statistics locking feature in the future.

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.