SHOW READWRITE_SPLITTING RULE

Description

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

Syntax

Grammar Railroad diagram

  1. ShowReadWriteSplittingRule::=
  2. 'SHOW' 'READWRITE_SPLITTING' ('RULE' ruleName | 'RULES') ('FROM' databaseName)?
  3. ruleName ::=
  4. identifier
  5. databaseName ::=
  6. 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
write_data_source_nameWrite data source name
read_data_source_namesRead data source name list
transactional_read_query_strategyRouting strategy for read query within a transaction
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 readwrite_splitting_db;
  1. mysql> SHOW READWRITE_SPLITTING RULES FROM readwrite_splitting_db;
  2. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  3. | name | write_storage_unit_name | read_storage_unit_names | transactional_read_query_strategy | load_balancer_type | load_balancer_props |
  4. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  5. | ms_group_0 | write_ds | read_ds_0,read_ds_1 | DYNAMIC | 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 | write_storage_unit_name | read_storage_unit_names | transactional_read_query_strategy | load_balancer_type | load_balancer_props |
  4. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  5. | ms_group_0 | write_ds | read_ds_0,read_ds_1 | DYNAMIC | random | |
  6. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  7. 1 row in set (0.01 sec)
  • Query specified readwrite-splitting rule for specified database.
  1. SHOW READWRITE_SPLITTING RULE ms_group_0 FROM readwrite_splitting_db;
  1. mysql> SHOW READWRITE_SPLITTING RULE ms_group_0 FROM readwrite_splitting_db;
  2. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  3. | name | write_storage_unit_name | read_storage_unit_names | transactional_read_query_strategy | load_balancer_type | load_balancer_props |
  4. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  5. | ms_group_0 | write_ds | read_ds_0,read_ds_1 | DYNAMIC | random | |
  6. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  7. 1 row in set (0.01 sec)
  • Query specified readwrite-splitting rule for current database.
  1. SHOW READWRITE_SPLITTING RULE ms_group_0;
  1. mysql> SHOW READWRITE_SPLITTING RULE ms_group_0;
  2. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  3. | name | write_storage_unit_name | read_storage_unit_names | transactional_read_query_strategy | load_balancer_type | load_balancer_props |
  4. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  5. | ms_group_0 | write_ds | read_ds_0,read_ds_1 | DYNAMIC | random | |
  6. +------------+-------------------------+-------------------------+-----------------------------------+--------------------+---------------------+
  7. 1 row in set (0.01 sec)

Reserved word

SHOW, READWRITE_SPLITTING, RULE, RULES, FROM