Skip to content

Commit

Permalink
sql: add auto-analyze-ratio (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilin90 authored and alivxxx committed Apr 26, 2018
1 parent e59df04 commit b1ad558
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sql/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ ANALYZE TABLE TableName INDEX [IndexNameList]

For the `INSERT`, `DELETE`, or `UPDATE` statements, TiDB automatically updates the number of rows and updated rows. TiDB persists this information regularly and the update cycle is 5 * `stats-lease`. The default value of `stats-lease` is `3s`. If you specify the value as `0`, it does not update automatically.

When the ratio of the number of modified rows to the total number of rows is greater than `auto-analyze-ratio`, TiDB automatically starts the `Analyze` statement. You can modify the value of `auto-analyze-ratio` in the configuration file. The default value is `0`, which means that this function is not enabled.

When the query is executed, TiDB collects feedback with the probability of `feedback-probability` and uses it to update the histogram and Count-Min Sketch. You can modify the value of `feedback-probability` in the configuration file. The default value is `0`.

### Control `ANALYZE` concurrency
Expand Down

0 comments on commit b1ad558

Please sign in to comment.