SHOW READWRITE_SPLITTING RULES

Description

The SHOW READWRITE_SPLITTING RULES syntax is used to query readwrite splitting rules for specified database.

Syntax

  1. ShowReadWriteSplittingRule::=
  2. 'SHOW' 'READWRITE_SPLITTING' 'RULES' ('FROM' databaseName)?
  3. databaseName ::=
  4. identifier

Supplement

  • When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.

Return value description

ColumnDescription
nameReadwrite splitting rule name
auto_aware_data_source_nameAuto-Aware discovery data source name (Display configuration dynamic readwrite splitting rules)
write_data_source_query_enabledAll read data source are offline, write data source whether the data source is responsible for read traffic
write_data_source_nameWrite data source name
read_data_source_namesRead data source name list
load_balancer_typeLoad balance algorithm type
load_balancer_propsLoad balance algorithm parameter

Example

  • Query readwrite splitting rules for specified database.
  1. SHOW READWRITE_SPLITTING RULES FROM sharding_db;
  1. mysql> SHOW READWRITE_SPLITTING RULES FROM sharding_db;
  2. +------------+-----------------------------+---------------------------------+------------------------+------------------------+--------------------+---------------------+
  3. | name | auto_aware_data_source_name | write_data_source_query_enabled | write_data_source_name | read_data_source_names | load_balancer_type | load_balancer_props |
  4. +------------+-----------------------------+---------------------------------+------------------------+------------------------+--------------------+---------------------+
  5. | ms_group_0 | | | resource_1 | ds_0,ds_1 | random | |
  6. +------------+-----------------------------+---------------------------------+------------------------+------------------------+--------------------+---------------------+
  7. 1 row in set (0.01 sec)
  • Query readwrite splitting rules for current database.
  1. SHOW READWRITE_SPLITTING RULES;
  1. mysql> SHOW READWRITE_SPLITTING RULES;
  2. +------------+-----------------------------+---------------------------------+------------------------+------------------------+--------------------+---------------------+
  3. | name | auto_aware_data_source_name | write_data_source_query_enabled | write_data_source_name | read_data_source_names | load_balancer_type | load_balancer_props |
  4. +------------+-----------------------------+---------------------------------+------------------------+------------------------+--------------------+---------------------+
  5. | ms_group_0 | | | resource_1 | ds_0,ds_1 | random | |
  6. +------------+-----------------------------+---------------------------------+------------------------+------------------------+--------------------+---------------------+
  7. 1 row in set (0.01 sec)

Reserved word

SHOW, READWRITE_SPLITTING, RULES, FROM