You can execute the CREATE TABLEGROUP statement to create a table group in a database. This syntax applies to only AUTO mode databases.


A table group is a table attribute. In PolarDB-X, you can create a table group and then associate multiple tables with the table group. Tables in the same table group must use the same partitioning policy. In addition, partition changes must be synchronized to all partitioned tables in the same table group. For example, if you want to split a partition of a table in a table group, you must split the same partitions of the other tables in this table group.


CREATE tablegroup [IF NOT EXISTS] tablegroup_name


Create a table group named test_tg.

create tablegroup test_tg;

After you create the table group, you can execute the show tablegroup statement to query the information about the table group. For example, execute the following statement to query the information about the test_tg table group:

show tablegroup where TABLE_GROUP_NAME='test_tg'

results matching ""

    No results matching ""