Retro Eye care Haitian Deep Dark Default

ALTER SHARDING TABLE REFERENCE RULE

Description

The ALTER SHARDING TABLE REFERENCE RULE syntax is used to alter reference table rules.

Syntax

AlterShardingTableReferenceRule ::=
  'ALTER' 'SHARDING' 'TABLE' 'REFERENCE' 'RULE'  referenceRelationshipDefinition  (',' referenceRelationshipDefinition )*

referenceRelationshipDefinition ::=
  '(' tableName (',' tableName)* ')'

tableName ::=
  identifier

Supplement

  • A sharding table can only have one reference relationships;
  • The sharding table for creating reference relationships needs to use the same storage unit and the same actual tables. For example su_${0..1}.t_order_${0..1}su_${0..1}.t_order_item_${0..1};
  • The sharding table for creating reference relationships needs to use the same sharding algorithm for the sharding column. For example t_order_{order_id % 2} and t_order_item_{order_item_id % 2};

Example

1. Alter a reference table rule

ALTER SHARDING TABLE REFERENCE RULE (t_order,t_order_item);

2. Alter multiple reference table rules

ALTER SHARDING TABLE REFERENCE RULE (t_order,t_order_item),(t_product,t_product_item);

Reserved word

ALTER, SHARDING, TABLE, REFERENCE, RULE