Skip to content

Commit

Permalink
Update sql-faq.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxsd authored and ti-chi-bot committed Feb 23, 2024
1 parent eac759b commit 8bc15d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ You can combine the above two parameters with the DML of TiDB to use them. For e

## What's the trigger strategy for `auto analyze` in TiDB?

When the number of rows in a new table reaches 1000, and the ratio (the number of modified rows / the current total number of rows) is larger than `tidb_auto_analyze_ratio`, the `auto analyze` statement is automatically triggered. The default value of `tidb_auto_analyze_ratio` is `0.5`, indicating that this feature is enabled by default. To ensure safety, its minimum value is `0.3` when the feature is enabled, and it must be smaller than `pseudo-estimate-ratio` whose default value is `0.8`; otherwise pseudo statistics will be used for a period of time. It is recommended to set `tidb_auto_analyze_ratio` to `0.5`.
When the number of rows in a new table reaches 1000, and the ratio (the number of modified rows / the current total number of rows) is larger than `tidb_auto_analyze_ratio`, the [`ANALYZE`](/sql-statements/sql-statement-analyze-table.md) statement is automatically triggered. The default value of `tidb_auto_analyze_ratio` is `0.5`, indicating that this feature is enabled by default. To ensure safety, its minimum value is `0.3` when the feature is enabled, and it must be smaller than `pseudo-estimate-ratio` whose default value is `0.8`; otherwise pseudo statistics will be used for a period of time. It is recommended to set `tidb_auto_analyze_ratio` to `0.5`.

To disable `auto analyze`, use the system variable `tidb_enable_auto_analyze`.

Expand Down

0 comments on commit 8bc15d8

Please sign in to comment.