SHOW [GLOBAL|SESSION] VARIABLES

SHOW [GLOBAL|SESSION] VARIABLES 语句用于显示 GLOBALSESSION 范围的变量列表。如果未指定范围,则应用默认范围 SESSION

语法图

ShowStmt:

\[global|session\]variables\_1.png

ShowTargetFilterable:

\[global|session\]variables\_2.png

GlobalScope:

\[global|session\]variables\_3.png

示例

mysql> SHOW GLOBAL VARIABLES LIKE 'tidb%';
+------------------------------------+--------------+
| Variable_name                      | Value        |
+------------------------------------+--------------+
| tidb_ddl_reorg_worker_cnt          | 16           |
| tidb_check_mb4_value_in_utf8       | 1            |
| tidb_opt_agg_push_down             | 0            |
| tidb_retry_limit                   | 10           |
| tidb_constraint_check_in_place     | 0            |
| tidb_ddl_reorg_priority            | PRIORITY_LOW |
| tidb_current_ts                    | 0            |
| tidb_mem_quota_indexlookupjoin     | 34359738368  |
| tidb_query_log_max_len             | 2048         |
| tidb_enable_cascades_planner       | 0            |
| tidb_mem_quota_topn                | 34359738368  |
| tidb_index_lookup_join_concurrency | 4            |
| tidb_auto_analyze_end_time         | 23:59 +0000  |
| tidb_mem_quota_query               | 34359738368  |
| tidb_optimizer_selectivity_level   | 0            |
| tidb_index_serial_scan_concurrency | 1            |
| tidb_dml_batch_size                | 20000        |
| tidb_max_chunk_size                | 1024         |
| tidb_enable_table_partition        | auto         |
| tidb_mem_quota_indexlookupreader   | 34359738368  |
| tidb_enable_window_function        | 0            |
| tidb_opt_write_row_id              | 0            |
| tidb_ddl_error_count_limit         | 512          |
| tidb_batch_delete                  | 0            |
| tidb_mem_quota_sort                | 34359738368  |
| tidb_enable_streaming              | 0            |
| tidb_opt_insubq_to_join_and_agg    | 1            |
| tidb_build_stats_concurrency       | 4            |
| tidb_projection_concurrency        | 4            |
| tidb_mem_quota_mergejoin           | 34359738368  |
| tidb_hashagg_final_concurrency     | 4            |
| tidb_checksum_table_concurrency    | 4            |
| tidb_batch_insert                  | 0            |
| tidb_slow_query_file               |              |
| tidb_index_join_batch_size         | 25000        |
| tidb_ddl_reorg_batch_size          | 1024         |
| tidb_enable_fast_analyze           | 0            |
| tidb_config                        |              |
| tidb_distsql_scan_concurrency      | 15           |
| tidb_hashagg_partial_concurrency   | 4            |
| tidb_init_chunk_size               | 32           |
| tidb_backoff_lock_fast             | 100          |
| tidb_skip_utf8_check               | 0            |
| tidb_hash_join_concurrency         | 5            |
| tidb_index_lookup_concurrency      | 4            |
| tidb_slow_log_threshold            | 300          |
| tidb_index_lookup_size             | 20000        |
| tidb_force_priority                | NO_PRIORITY  |
| tidb_auto_analyze_start_time       | 00:00 +0000  |
| tidb_mem_quota_nestedloopapply     | 34359738368  |
| tidb_snapshot                      |              |
| tidb_general_log                   | 0            |
| tidb_batch_commit                  | 0            |
| tidb_enable_radix_join             | 0            |
| tidb_skip_isolation_level_check    | 0            |
| tidb_auto_analyze_ratio            | 0.5          |
| tidb_disable_txn_auto_retry        | 0            |
| tidb_mem_quota_hashjoin            | 34359738368  |
+------------------------------------+--------------+
 rows in set (0.01 sec)
mysql> SHOW GLOBAL VARIABLES LIKE 'time_zone%';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| time_zone     | SYSTEM |
+---------------+--------+
 row in set (0.00 sec)

MySQL 兼容性

SHOW [GLOBAL|SESSION] VARIABLES 语句与 MySQL 完全兼容。如有任何兼容性差异,请在 GitHub 上提交 issue。

另请参阅

  • SET

看完两件小事

如果你觉得这篇文章对你挺有启发,我想请你帮我两个小忙:

  1. 关注我们的 GitHub 博客,让我们成为长期关系
  2. 把这篇文章分享给你的朋友 / 交流群,让更多的人看到,一起进步,一起成长!
  3. 关注公众号 「方志朋」,公众号后台回复「资源」 免费领取我精心整理的前端进阶资源教程

JS中文网是中国领先的新一代开发者社区和专业的技术媒体,一个帮助开发者成长的社区,目前已经覆盖和服务了超过 300 万开发者,你每天都可以在这里找到技术世界的头条内容。欢迎热爱技术的你一起加入交流与学习,JS中文网的使命是帮助开发者用代码改变世界

results matching ""

    No results matching ""