TiDB 真正支持的MySQL参数和tidb专用的参数

--版本:
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.1-1-g01c6bd8
Git Commit Hash: 01c6bd820c752d6ee739020fd425caff94b96368
Git Branch: master
UTC Build Time: 2018-08-24 01:55:43
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)

--真正支持的MySQL参数:
变量名	作用域	说明
autocommit	 GLOBAL | SESSION	是否自动 Commit 事务
sql_mode	 GLOBAL | SESSION	支持部分 MySQL SQL mode,
time_zone	 GLOBAL | SESSION	数据库所使用的时区
tx_isolation GLOBAL | SESSION	事务隔离级别

--tiDB自定义的一些参数:
目前共有40个参数,其中tidb_config参数较多。
可以通过命令查询:
mysql> show variables like 'tidb_%';
也可通过information_schema.SESSION_VARIABLES查询:
mysql> select * from (select * from information_schema.SESSION_VARIABLES where VARIABLE_NAME like 'tidb_%') t where t.VARIABLE_NAME  <>'tidb_config';
+------------------------------------+--------------------+
| VARIABLE_NAME                      | VARIABLE_VALUE     |
+------------------------------------+--------------------+
| tidb_mem_quota_sort                | 34359738368        |
| tidb_retry_limit                   | 10                 |
| tidb_general_log                   | 0                  |
| tidb_projection_concurrency        | 4                  |
| tidb_mem_quota_mergejoin           | 34359738368        |
| tidb_batch_insert                  | 0                  |
| tidb_opt_insubquery_unfold         | 0                  |
| tidb_mem_quota_nestedloopapply     | 34359738368        |
| tidb_mem_quota_topn                | 34359738368        |
| tidb_index_lookup_size             | 20000              |
| tidb_mem_quota_indexlookupjoin     | 34359738368        |
| tidb_mem_quota_query               | 34359738368        |
| tidb_batch_delete                  | 0                  |
| tidb_disable_txn_auto_retry        | 0                  |
| tidb_max_chunk_size                | 32                 |
| tidb_ddl_reorg_priority            | PRIORITY_LOW       |
| tidb_index_serial_scan_concurrency | 1                  |
| tidb_skip_utf8_check               | 0                  |
| tidb_enable_streaming              | 0                  |
| tidb_hashagg_final_concurrency     | 4                  |
| tidb_auto_analyze_ratio            | 0.5                |
| tidb_snapshot                      |                    |
| tidb_index_lookup_join_concurrency | 4                  |
| tidb_checksum_table_concurrency    | 4                  |
| tidb_hashagg_partial_concurrency   | 4                  |
| tidb_opt_agg_push_down             | 0                  |
| tidb_current_ts                    | 402711170386755610 |
| tidb_mem_quota_hashjoin            | 34359738368        |
| tidb_mem_quota_indexlookupreader   | 34359738368        |
| tidb_dml_batch_size                | 20000              |
| tidb_optimizer_selectivity_level   | 0                  |
| tidb_ddl_reorg_worker_cnt          | 16                 |
| tidb_backoff_lock_fast             | 100                |
| tidb_index_lookup_concurrency      | 4                  |
| tidb_enable_table_partition        | 0                  |
| tidb_build_stats_concurrency       | 4                  |
| tidb_distsql_scan_concurrency      | 15                 |
| tidb_hash_join_concurrency         | 5                  |
| tidb_index_join_batch_size         | 25000              |
+------------------------------------+--------------------+
39 rows in set (0.00 sec)

上述参数均可以在session级别设置,下列参数也可以在global级别设置:
tidb_distsql_scan_concurrency
tidb_index_lookup_size
tidb_index_lookup_concurrency
tidb_index_lookup_join_concurrency
tidb_hash_join_concurrency
tidb_index_serial_scan_concurrency
tidb_projection_concurrency
tidb_hashagg_partial_concurrency
tidb_hashagg_final_concurrency
tidb_index_join_batch_size
tidb_skip_utf8_check
tidb_max_chunk_size
tidb_retry_limit
tidb_disable_txn_auto_retry
tidb_backoff_lock_fast
tidb_ddl_reorg_worker_cnt
tidb_ddl_reorg_priority

--参数修改示例:
set @@tidb_distsql_scan_concurrency = 10;
set @@global.tidb_distsql_scan_concurrency = 10;

--tidb专用的参数:
tidb_general_log
作用域:SERVER
默认值:0
这个变量用来设置是否在日志里记录所有的 SQL 语句。

--在实际应用中可能需要修改的tidb专用参数:

--参考:
https://www.pingcap.com/docs-cn/sql/tidb-specific/

 

你可能感兴趣的:(TiDB)