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 105689d commit eac759b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,9 @@ 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?

Trigger strategy: `auto analyze` is automatically triggered when the number of rows in a new table reaches 1000.
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 ratio (the number of modified rows / the current total number of rows) is larger than `tidb_auto_analyze_ratio`, the `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.

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

## Can I use optimizer hints to override the optimizer behavior?

Expand Down

0 comments on commit eac759b

Please sign in to comment.