Error When Manually Triggering Analyze Table in TiDB

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

Original topic: TIDB 手动触发analyze table报错

| username: residentevil

[TiDB Usage Environment] Production Environment
[TiDB Version] V6.5.8
[Encountered Problem: Problem Phenomenon and Impact] ERROR 1105 (HY000): Fast analyze hasn’t reached General Availability and only supports analyze version 1 currently

| username: gcworkerishungry | Original post link

Check this value, if it is on, it is recommended to turn it off and try again.

| username: Soysauce520 | Original post link

Is it an upgraded cluster, or was 6.5.8 directly deployed?

| username: buddyyuan | Original post link

What is your tidb_analyze_version set to? This error is quite obvious. Only support analyze version 1 currently.

| username: Daniel-W | Original post link

There is a similar post, you can refer to TiDB-v5.3.1 中 analyze table 报错:ERROR 1105 (HY000) - TiDB 的问答社区

| username: residentevil | Original post link

Set to 2

| username: WalterWj | Original post link

The error indicates that there is a compatibility issue between the fast analyze optimization and the Analyze version. Either disable fast analyze or use version 1.

| username: DBAER | Original post link

It seems to be not very compatible. I saw a prompt that it will be deprecated in later versions.

| username: vcdog | Original post link

Starting from v7.5.0, this variable has been deprecated.

  • Persisted to cluster: Yes
  • Controlled by Hint SET_VAR: No
  • Type: Boolean
  • Default value: OFF
  • This variable is used to control whether to enable the fast statistics analysis feature. The default value of 0 means it is not enabled.
  • When the fast analysis feature is enabled, TiDB will randomly sample about 10,000 rows of data to build statistics. Therefore, in cases where data distribution is uneven or the data volume is relatively small, the accuracy of the statistics may be low. This could lead to suboptimal execution plans, such as choosing the wrong index. If you can tolerate the execution time of the regular ANALYZE statement, it is recommended to disable the fast analysis feature.

According to the official documentation, this parameter has been deprecated since version v7.5.0. In version v6.5.x, you can check the parameter and set it to 1 to perform table analysis for statistics.

| username: kelvin | Original post link


| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.