GBase 8a数据库集群,从V95版本开始,支持多列hash,用于改善数据倾斜问题。理论上其最大数量和列数量相同的2000个,但由于源数据表table_distribution里hash_column列最大长度是4096,实际列数会小于理论值。
一些新版本,限制了最多10hash列。一般也够用了。
目录导航
测试2000个列的Hash分布列
直接报错 hash column string is too long for gbase system table。
gbase> source /home/gbase/t2000.sql
ERROR 1901 (HY000): hash column string is too long for gbase system table
gbase> use gbase;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)
gbase> desc table_distribution;
+----------------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+---------+-------+
| index_name | varchar(128) | NO | PRI | NULL | |
| dbName | varchar(64) | NO | | NULL | |
| tbName | varchar(64) | NO | | NULL | |
| isReplicate | varchar(3) | NO | | YES | |
| hash_column | varchar(4096) | YES | | NULL | |
| lmt_storage_size | bigint(20) | YES | | NULL | |
| table_storage_size | bigint(20) | YES | | NULL | |
| is_nocopies | varchar(3) | NO | | YES | |
| data_distribution_id | bigint(8) | NO | | NULL | |
| vc_id | varchar(64) | NO | PRI | NULL | |
| mirror_vc_id | varchar(64) | YES | | NULL | |
+----------------------+---------------+------+-----+---------+-------+
11 rows in set (Elapsed: 00:00:00.00)
新版本10个限制的