Skip to content

Commit

Permalink
tidb-server: add tidb_scatter_region (#1711)
Browse files Browse the repository at this point in the history
* add tidb_scatter_region

Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Lilian Lee <lilin@pingcap.com>
  • Loading branch information
jackysp and lilin90 committed Aug 7, 2019
1 parent ab234ba commit 79e2691
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Expand Up @@ -636,3 +636,11 @@ select * from t, t1 where t.a=t1.a
默认值:300

这个变量用来设置 `SPLIT REGION` 语句的执行超时时间,单位是秒,默认值是 300 秒,如果超时还未完成,就返回一个超时错误。

### tidb_scatter_region

作用域:GLOBAL

默认值:0

TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在建表语句执行时,同步打散刚分裂出的 Region。适用于批量建表后紧接着批量写入数据,能让刚分裂出的 Region 先在 TiKV 分散而不用等待 PD 进行调度。为了保证后续批量写入数据的稳定性,建表语句会等待打散 Region 完成后再返回建表成功,建表语句执行时间会是关闭该变量的数倍。
Expand Up @@ -435,3 +435,11 @@ set tidb_slow_log_threshold = 200
```sql
set tidb_query_log_max_len = 20
```

### tidb_scatter_region

作用域:GLOBAL

默认值:0

TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在建表语句执行时,同步打散刚分裂出的 Region。适用于批量建表后紧接着批量写入数据,能让刚分裂出的 Region 先在 TiKV 分散而不用等待 PD 进行调度。为了保证后续批量写入数据的稳定性,建表语句会等待打散 Region 完成后再返回建表成功,建表语句执行时间会是关闭该变量的数倍。
Expand Up @@ -638,3 +638,11 @@ select * from t, t1 where t.a=t1.a
默认值:300

这个变量用来设置 `SPLIT REGION` 语句的执行超时时间,单位是秒,默认值是 300 秒,如果超时还未完成,就返回一个超时错误。

### tidb_scatter_region

作用域:GLOBAL

默认值:0

TiDB 默认会在建表时为新表分裂 Region。开启该变量后,会在建表语句执行时,同步打散刚分裂出的 Region。适用于批量建表后紧接着批量写入数据,能让刚分裂出的 Region 先在 TiKV 分散而不用等待 PD 进行调度。为了保证后续批量写入数据的稳定性,建表语句会等待打散 Region 完成后再返回建表成功,建表语句执行时间会是关闭该变量的数倍。

0 comments on commit 79e2691

Please sign in to comment.