一、测试环境
名称 | 值 |
---|---|
cpu | 12th Gen Intel® Core™ i7-12700H |
操作系统 | CentOS Linux release 7.9.2009 (Core) |
内存 | 3G |
逻辑核数 | 2 |
Gbase-8a数据库版本 | 9.5.3.27 |
二、小实验
1、查询集群中包含的数据库
gbase> select * from information_schema.schemata;
+--------------+--------------+--------------------+----------------------------+------------------------+----------+----------------+
| CATALOG_NAME | VC_NAME | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH | MIRROR_VC_NAME |
+--------------+--------------+--------------------+----------------------------+------------------------+----------+----------------+
| NULL | | information_schema | utf8mb4 | utf8mb4_general_ci | NULL | |
| NULL | | performance_schema | utf8mb4 | utf8mb4_general_ci | NULL | |
| NULL | | gbase | utf8 | utf8_general_ci | NULL | |
| NULL | | gctmpdb | utf8 | utf8_general_ci | NULL | |
| NULL | vcname000001 | czg | utf8 | utf8_general_ci | NULL | |
| NULL | vcname000001 | gclusterdb | utf8 | utf8_general_ci | NULL | |
+--------------+--------------+--------------------+----------------------------+------------------------+----------+----------------+
6 rows in set (Elapsed: 00:00:00.01)
2、查询VC虚拟集群
gbase> select * from information_schema.vc;
+---------+--------------+---------+
| ID | NAME | DEFAULT |
+---------+--------------+---------+
| vc00001 | vcname000001 | Y |
+---------+--------------+---------+
1 row in set (Elapsed: 00:00:00.00)
3、查询集群中的表和视图
gbase> select * from information_schema.tables where table_schema='czg';
+---------------+--------------+--------------+------------+------------+---------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+--------------------+--------------------------+--------------------+-----------------+---------------+----------------------------+-----------------------------+-------+----------+-----------+---------+-----------------+-----------------+
| TABLE_CATALOG | TABLE_VC | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | ENGINE | VERSION | ROW_FORMAT | TABLE_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH | DATA_FREE | AUTO_INCREMENT | CREATE_TIME | UPDATE_TIME | CHECK_TIME | TABLE_COLLATION | CHECKSUM | CREATE_OPTIONS | TABLE_LIMIT_STORAGE_SIZE | TABLE_STORAGE_SIZE | TABLE_DATA_SIZE | TABLE_COMMENT | LOCAL_HASH_INDEX_FILE_SIZE | GLOBAL_HASH_INDEX_FILE_SIZE | SCN | TABLE_ID | OWNER_UID | VC_ID | TABLESPACE_NAME | TABLESPACE_PATH |
+---------------+--------------+--------------+------------+------------+---------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+--------------------+--------------------------+--------------------+-----------------+---------------+----------------------------+-----------------------------+-------+----------+-----------+---------+-----------------+-----------------+
| NULL | vcname000001 | czg | czg | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:13:33 | 2022-10-10 10:13:33 | NULL | utf8_general_ci | NULL | avg_row_length=307 | 0 | 421 | 0 | | 0 | 0 | 30744 | 119 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | czg_1 | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:13:33 | 2022-10-10 10:13:33 | NULL | utf8_general_ci | NULL | avg_row_length=307 | 0 | 421 | 0 | | 0 | 0 | 30746 | 122 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | czg_copy | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:13:33 | 2022-10-10 10:13:33 | NULL | utf8_general_ci | NULL | avg_row_length=307 | 0 | 421 | 0 | | 0 | 0 | 30748 | 125 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | czg_hash | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:13:33 | 2022-10-10 10:13:33 | NULL | utf8_general_ci | NULL | avg_row_length=307 | 0 | 421 | 0 | | 0 | 0 | 30750 | 126 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | czg_hash_1 | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:13:33 | 2022-10-10 10:13:33 | NULL | utf8_general_ci | NULL | avg_row_length=307 | 0 | 421 | 0 | | 0 | 0 | 30752 | 129 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | czg_hash_2 | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:13:33 | 2022-10-10 10:13:33 | NULL | utf8_general_ci | NULL | avg_row_length=307 | 0 | 421 | 0 | | 0 | 0 | 30754 | 132 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | haha | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-11 11:26:55 | 2022-10-11 11:26:55 | NULL | utf8_general_ci | NULL | avg_row_length=5 | 0 | 284 | 0 | | 0 | 0 | 31745 | 162 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | sun | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:59:09 | 2022-10-10 10:59:09 | NULL | utf8_general_ci | NULL | avg_row_length=358 | 0 | 1222 | 0 | | 0 | 0 | 29715 | 135 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | sun_copy | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-10 10:13:34 | 2022-10-10 10:13:34 | NULL | utf8_general_ci | NULL | avg_row_length=358 | 0 | 1222 | 0 | | 0 | 0 | 30758 | 138 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | tb_like | BASE TABLE | EXPRESS | 10 | Compressed | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 2022-10-18 11:04:17 | 2022-10-18 11:04:17 | NULL | utf8_general_ci | NULL | avg_row_length=307 | 0 | 1892 | 0 | | 0 | 0 | 76805 | 257 | 1 | vc00001 | sys_tablespace | . |
| NULL | vcname000001 | czg | v_test | VIEW | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW | NULL | NULL | NULL | NULL | 0 | vc00001 | NULL | NULL |
+---------------+--------------+--------------+------------+------------+---------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+--------------------+--------------------------+--------------------+-----------------+---------------+----------------------------+-----------------------------+-------+----------+-----------+---------+-----------------+-----------------+
11 rows in set (Elapsed: 00:00:00.00)
4、查询列信息
gbase> select * from information_schema.columns where table_schema='czg' limit 10;
+---------------+--------------+--------------+------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+-----------------+--------------+------------+-------+---------------------------------+----------------+
| TABLE_CATALOG | TABLE_VC | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | ORDINAL_POSITION | COLUMN_DEFAULT | IS_NULLABLE | DATA_TYPE | CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH | NUMERIC_PRECISION | NUMERIC_SCALE | CHARACTER_SET_NAME | COLLATION_NAME | COLUMN_TYPE | COLUMN_KEY | EXTRA | PRIVILEGES | COLUMN_COMMENT |
+---------------+--------------+--------------+------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+-----------------+--------------+------------+-------+---------------------------------+----------------+
| NULL | vcname000001 | czg | czg | a | 1 | NULL | YES | int | NULL | NULL | 10 | 0 | NULL | NULL | int(11) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg | name | 2 | NULL | YES | varchar | 100 | 300 | NULL | NULL | utf8 | utf8_general_ci | varchar(100) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_1 | a | 1 | NULL | YES | int | NULL | NULL | 10 | 0 | NULL | NULL | int(11) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_1 | name | 2 | NULL | YES | varchar | 100 | 300 | NULL | NULL | utf8 | utf8_general_ci | varchar(100) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_copy | a | 1 | NULL | YES | int | NULL | NULL | 10 | 0 | NULL | NULL | int(11) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_copy | name | 2 | NULL | YES | varchar | 100 | 300 | NULL | NULL | utf8 | utf8_general_ci | varchar(100) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_hash | a | 1 | NULL | YES | int | NULL | NULL | 10 | 0 | NULL | NULL | int(11) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_hash | name | 2 | NULL | YES | varchar | 100 | 300 | NULL | NULL | utf8 | utf8_general_ci | varchar(100) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_hash_1 | a | 1 | NULL | YES | int | NULL | NULL | 10 | 0 | NULL | NULL | int(11) | | | select,insert,update,references | |
| NULL | vcname000001 | czg | czg_hash_1 | name | 2 | NULL | YES | varchar | 100 | 300 | NULL | NULL | utf8 | utf8_general_ci | varchar(100) | | | select,insert,update,references | |
+---------------+--------------+--------------+------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+-----------------+--------------+------------+-------+---------------------------------+----------------+
10 rows in set (Elapsed: 00:00:00.01)
5、查询存储过程以及函数
gbase> select * from information_schema.routines;
+------------------------------------------------------------------+-----------------+--------------+------------------------------------------------------------------+------------------------------------------------------------------+--------------+----------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------------+-----------------+------------------+-----------------+----------+---------------+---------------------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+
| SPECIFIC_NAME | ROUTINE_CATALOG | ROUTINE_VC | ROUTINE_SCHEMA | ROUTINE_NAME | ROUTINE_TYPE | DTD_IDENTIFIER | ROUTINE_BODY | ROUTINE_DEFINITION | EXTERNAL_NAME | EXTERNAL_LANGUAGE | PARAMETER_STYLE | IS_DETERMINISTIC | SQL_DATA_ACCESS | SQL_PATH | SECURITY_TYPE | CREATED | LAST_ALTERED | SQL_MODE | ROUTINE_COMMENT | DEFINER | CHARACTER_SET_CLIENT | COLLATION_CONNECTION | DATABASE_COLLATION |
+------------------------------------------------------------------+-----------------+--------------+------------------------------------------------------------------+------------------------------------------------------------------+--------------+----------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------------+-----------------+------------------+-----------------+----------+---------------+---------------------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+
| GenerateTestData | NULL | vcname000001 | czg | GenerateTestData | PROCEDURE | NULL | SQL | begin
declare tempval int;
set tempval = 1;
set autocommit = off;
label: loop
insert into TB_LIKE values(tempval,tempval||'太阳光'||tempval);
if tempval >= num then
leave label;
else
set tempval = tempval + 1;
end if;
end loop label;
commit;
end | NULL | NULL | SQL | NO | CONTAINS SQL | NULL | DEFINER | 2022-10-18 10:24:26 | 2022-10-18 10:24:26 | PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH | | root@% | utf8 | utf8_general_ci | utf8_general_ci |
+------------------------------------------------------------------+-----------------+--------------+------------------------------------------------------------------+------------------------------------------------------------------+--------------+----------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------------+-----------------+------------------+-----------------+----------+---------------+---------------------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------+----------------------------------+----------------------------------+
1 row in set (Elapsed: 00:00:00.00)
6、查询索引信息
gbase> select * from information_schema.statistics where table_schema='czg';
+---------------+--------------+--------------+------------+------------+--------------+------------+--------------+-------------+-----------+-------------+----------+--------+----------+------------+---------+
| TABLE_CATALOG | TABLE_VC | TABLE_SCHEMA | TABLE_NAME | NON_UNIQUE | INDEX_SCHEMA | INDEX_NAME | SEQ_IN_INDEX | COLUMN_NAME | COLLATION | CARDINALITY | SUB_PART | PACKED | NULLABLE | INDEX_TYPE | COMMENT |
+---------------+--------------+--------------+------------+------------+--------------+------------+--------------+-------------+-----------+-------------+----------+--------+----------+------------+---------+
| NULL | vcname000001 | czg | tb_like | 1 | czg | ft_index | 1 | B | NULL | NULL | NULL | NULL | YES | FULLTEXT | |
+---------------+--------------+--------------+------------+------------+--------------+------------+--------------+-------------+-----------+-------------+----------+--------+----------+------------+---------+
1 row in set (Elapsed: 00:00:00.01)
7、查看集群目录的磁盘占用情况**
gbase> select * from performance_schema.cluster_disk_usage_info;
+-----------------------+--------------------------------+-----------------------------------------------------+-----------+------------+--------------+-------------+-------------+-----+
| HOST | DIR_TYPE | PATH | DIR_SIZE | FILESYSTEM | SIZE | USED | AVAIL | PCT |
+-----------------------+--------------------------------+-----------------------------------------------------+-----------+------------+--------------+-------------+-------------+-----+
| czg0 | datadir[gnode] | /opt/192.168.217.67/gnode/userdata/gbase/ | 13844480 | /dev/sda2 | 106248536064 | 30882414592 | 75366121472 | 29% |
| czg0 | gbase_cache_data_dir[gnode] | /opt/192.168.217.67/gnode/tmpdata/cache_gbase | 0 | /dev/sda2 | 106248536064 | 30882414592 | 75366121472 | 29% |
| czg0 | logdir[gnode] | /opt/192.168.217.67/gnode/log/gbase/ | 655360 | /dev/sda2 | 106248536064 | 30882414592 | 75366121472 | 29% |
| localhost.localdomain | datadir[gnode] | /opt/192.168.217.66/gnode/userdata/gbase/ | 123129856 | /dev/sda2 | 106248536064 | 9080795136 | 97167740928 | 9% |
| localhost.localdomain | gbase_cache_data_dir[gnode] | /opt/192.168.217.66/gnode/tmpdata/cache_gbase | 0 | /dev/sda2 | 106248536064 | 9080795136 | 97167740928 | 9% |
| localhost.localdomain | logdir[gnode] | /opt/192.168.217.66/gnode/log/gbase/ | 675840 | /dev/sda2 | 106248536064 | 9080795136 | 97167740928 | 9% |
| localhost.localdomain | datadir[gcluster] | /opt/192.168.217.66/gcluster/userdata/gcluster/ | 7270400 | /dev/sda2 | 106248536064 | 9080795136 | 97167740928 | 9% |
| localhost.localdomain | gbase_cache_data_dir[gcluster] | /opt/192.168.217.66/gcluster/tmpdata/cache_gcluster | 0 | /dev/sda2 | 106248536064 | 9080795136 | 97167740928 | 9% |
| localhost.localdomain | logdir[gcluster] | /opt/192.168.217.66/gcluster/log/gcluster/ | 159744 | /dev/sda2 | 106248536064 | 9080795136 | 97167740928 | 9% |
| czg0 | datadir[gcluster] | /opt/192.168.217.67/gcluster/userdata/gcluster/ | 7270400 | /dev/sda2 | 106248536064 | 30882414592 | 75366121472 | 29% |
| czg0 | gbase_cache_data_dir[gcluster] | /opt/192.168.217.67/gcluster/tmpdata/cache_gcluster | 0 | /dev/sda2 | 106248536064 | 30882414592 | 75366121472 | 29% |
| czg0 | logdir[gcluster] | /opt/192.168.217.67/gcluster/log/gcluster/ | 278528 | /dev/sda2 | 106248536064 | 30882414592 | 75366121472 | 29% |
+-----------------------+--------------------------------+-----------------------------------------------------+-----------+------------+--------------+-------------+-------------+-----+
12 rows in set (Elapsed: 00:00:00.05)
占用多少M
gbase> select sum(dir_size)/1024/1024 as size from performance_schema.cluster_disk_usage_info;
+--------------+
| size |
+--------------+
| 146.69531250 |
+--------------+
1 row in set (Elapsed: 00:00:00.04)
8、查看数据库用户
gbase> select * from gbase.user;
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+-------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+-----------------+----------------+--------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+----------+--------------+---------------+----------------+---------------+-------------------------+-------------------+-----+-----------------------+-------------+
| Host | User | Password | Default_VC | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Unmask_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Drop_table_priv | Drop_view_priv | Drop_database_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | max_cpus | max_memories | max_tmp_space | resource_group | task_priority | user_limit_storage_size | user_storage_size | UID | plugin | auth_string |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+-------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+-----------------+----------------+--------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+----------+--------------+---------------+----------------+---------------+-------------------------+-------------------+-----+-----------------------+-------------+
| % | root | | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | | 0 | 1 | gbase_native_password | |
| % | gbase | *9C0ADBD7F08FA9D49D82760B104110C55B943B8D | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | | 0 | 2 | gbase_native_password | |
| % | czg | *D75CC763C5551A420D28A227AC294FADE26A2FF2 | | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | | 0 | 161 | gbase_native_password | |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+-------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+-----------------+----------------+--------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+----------+--------------+---------------+----------------+---------------+-------------------------+-------------------+-----+-----------------------+-------------+
3 rows in set (Elapsed: 00:00:00.01)
9、查看数据库用户组和用户关系对照表
gbase> create role role_sun;
Query OK, 0 rows affected (Elapsed: 00:00:00.03)
gbase> grant all on *.* to role_sun;
Query OK, 0 rows affected (Elapsed: 00:00:00.03)
gbase> grant role_sun to czg@'%';
Query OK, 0 rows affected (Elapsed: 00:00:00.02)
gbase> select * from gbase.role_edges;
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+-------------------+
| FROM_HOST | FROM_USER | TO_HOST | TO_USER | WITH_ADMIN_OPTION |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+-------------------+
| % | role_sun | % | czg | N |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+-------------------+
1 row in set (Elapsed: 00:00:00.00)
10、查看表的分布类型
gbase> select * from gbase.table_distribution;
+-------------------------------+------------+--------------------+-------------+-------------+------------------+--------------------+-------------+----------------------+---------+--------------+
| index_name | dbName | tbName | isReplicate | hash_column | lmt_storage_size | table_storage_size | is_nocopies | data_distribution_id | vc_id | mirror_vc_id |
+-------------------------------+------------+--------------------+-------------+-------------+------------------+--------------------+-------------+----------------------+---------+--------------+
| gclusterdb.rebalancing_status | gclusterdb | rebalancing_status | NO | index_name | NULL | NULL | NO | 1 | vc00001 | NULL |
| gclusterdb.dual | gclusterdb | dual | YES | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.sun_copy | czg | sun_copy | NO | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.haha | czg | haha | NO | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.sun | czg | sun | NO | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.czg_hash_2 | czg | czg_hash_2 | NO | name | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.czg_hash_1 | czg | czg_hash_1 | NO | a | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.czg_hash | czg | czg_hash | NO | a | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.czg_copy | czg | czg_copy | YES | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| gclusterdb.gc_stats_table | gclusterdb | gc_stats_table | YES | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| gclusterdb.gc_stats_column | gclusterdb | gc_stats_column | YES | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.czg_1 | czg | czg_1 | NO | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.czg | czg | czg | NO | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
| czg.tb_like | czg | tb_like | NO | NULL | NULL | NULL | NO | 1 | vc00001 | NULL |
+-------------------------------+------------+--------------------+-------------+-------------+------------------+--------------------+-------------+----------------------+---------+--------------+
14 rows in set (Elapsed: 00:00:00.00)
11、查看数据分布是否倾斜**
(1)随机分布表
gbase> show variables like'%random_insert%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| gcluster_random_insert | 0 |
+------------------------+-------+
1 row in set (Elapsed: 00:00:00.00)
这里是为了造一个数据分布倾斜的例子,所以把上面的参数置为0,再插入数据的缘故。
gbase> select * from information_schema.cluster_table_segments where table_schema='czg' and table_name ='sun';
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
| TABLE_VC | TABLE_SCHEMA | TABLE_NAME | SUFFIX | HOST | TABLE_DATA_SIZE | TABLE_STORAGE_SIZE | DATA_PERCENT |
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
| vcname000001 | czg | sun | n1 | 192.168.217.67 | 32523 | 35815 | 100.0000% |
| vcname000001 | czg | sun | n2 | 192.168.217.66 | 0 | 1222 | 0.0000% |
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
2 rows in set (Elapsed: 00:00:00.02)
(2)HASH分布表
gbase> select * from information_schema.cluster_table_segments where table_schema='czg' and table_name ='czg_hash_1';
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
| TABLE_VC | TABLE_SCHEMA | TABLE_NAME | SUFFIX | HOST | TABLE_DATA_SIZE | TABLE_STORAGE_SIZE | DATA_PERCENT |
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
| vcname000001 | czg | czg_hash_1 | n1 | 192.168.217.67 | 417172 | 418226 | 50.0534% |
| vcname000001 | czg | czg_hash_1 | n2 | 192.168.217.66 | 416282 | 417336 | 49.9466% |
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
2 rows in set (Elapsed: 00:00:00.00)
(3)复制表
gbase> select * from information_schema.cluster_table_segments where table_schema='czg' and table_name ='czg_copy';
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
| TABLE_VC | TABLE_SCHEMA | TABLE_NAME | SUFFIX | HOST | TABLE_DATA_SIZE | TABLE_STORAGE_SIZE | DATA_PERCENT |
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
| vcname000001 | czg | czg_copy | n1 | 192.168.217.67 | 3210408 | 3212098 | 100% |
+--------------+--------------+------------+--------+----------------+-----------------+--------------------+--------------+
1 row in set (Elapsed: 00:00:00.01)
12、查看表的总条数**
[gbase@localhost Python]$ gcadmin showdistribution
Distribution ID: 1 | State: new | Total segment num: 2
Primary Segment Node IP Segment ID Duplicate Segment node IP
========================================================================================================================
| 192.168.217.67 | 1 | |
------------------------------------------------------------------------------------------------------------------------
| 192.168.217.66 | 2 | |
========================================================================================================================
我这边是没有副本的,所以TABLE_ROWS 不需要除以副本总数加一。
gbase> select count(*) from czg.sun;
+----------+
| count(*) |
+----------+
| 65536 |
+----------+
1 row in set (Elapsed: 00:00:00.01)
gbase> select TABLE_ROWS from performance_schema.tables where table_schema ='czg' and table_name='sun';
+------------+
| TABLE_ROWS |
+------------+
| 65536 |
+------------+
1 row in set (Elapsed: 00:00:00.02)
13、查看数据库参数**
gbase> select * from information_schema.global_variables limit 10;
+----------------------------------------+----------------+---------------+-----------+
| VARIABLE_NAME | VARIABLE_VALUE | SESSION_LEVEL | WRITEABLE |
+----------------------------------------+----------------+---------------+-----------+
| GCLUSTER_MAX_CONN_IN_POOL | 300 | 0 | 1 |
| DIV_PRECISION_INCREMENT | 4 | 1 | 1 |
| GBASE_HDFS_NAMENODES | | 1 | 1 |
| TMP_TABLE_SIZE | 16777216 | 1 | 1 |
| PASSWORD_REUSE_MAX | 0 | 0 | 0 |
| _GBASE_AUTO_INCREMENT_ALLOW_INSERT | OFF | 1 | 1 |
| GBASE_KAFKA_PRODUCER_MESSAGE_MAX_BYTES | 8192 | 1 | 1 |
| BACK_LOG | 65535 | 0 | 0 |
| LOCAL_INFILE | ON | 0 | 1 |
| SQL_QUOTE_SHOW_CREATE | ON | 1 | 1 |
+----------------------------------------+----------------+---------------+-----------+
10 rows in set (Elapsed: 00:00:00.00)
14、查看数据分布在哪个分片中**
12太阳光12这个数据分布在0号分片上,一共两个分片。
gbase> select * from gbase.nodedatamap where hashkey = crc32('12太阳光12')%65536;
+---------+--------+----------------------+
| hashkey | nodeid | data_distribution_id |
+---------+--------+----------------------+
| 51204 | 0 | 2 |
+---------+--------+----------------------+
1 row in set (Elapsed: 00:00:00.00)
gbase> quit
Bye
[gbase@czg0 vc00001_gclusterdb]$ gcadmin showdistribution
Distribution ID: 2 | State: new | Total segment num: 2
Primary Segment Node IP Segment ID Duplicate Segment node IP
========================================================================================================================
| 192.168.142.11 | 1 | |
------------------------------------------------------------------------------------------------------------------------
| 192.168.142.10 | 2 | |
========================================================================================================================
15、查看集群中在进行的SQL**
gbase> select * from information_schema.processlist;
+----+---------+-----------+----------+-----------------+----------------------+--------------+------+---------+---------------------+------+-----------------------------+--------------------+------------------+------------------------+--------------+--------------+------+------+----------------------------------------------+-------+
| ID | TASKID | SUBTASKID | THREADID | USER | HOST | VC | DB | COMMAND | START_TIME | TIME | STATE | RESOURCE_POOL_NAME | RESOURCE_POOL_ID | RESOURCE_POOl_PRIORITY | WAITING_TIME | RUNNING_TIME | LOCK | WAIT | INFO | TRACE |
+----+---------+-----------+----------+-----------------+----------------------+--------------+------+---------+---------------------+------+-----------------------------+--------------------+------------------+------------------------+--------------+--------------+------+------+----------------------------------------------+-------+
| 22 | 3473422 | 0 | 4678 | root | localhost | vcname000001 | NULL | Query | 2022-10-28 14:34:53 | 0 | checking permissions | NULL | NULL | NULL | NULL | NULL | NULL | NULL | select * from information_schema.processlist | NULL |
| 11 | 0 | 0 | 4046 | gbase | 192.168.142.11:62050 | vcname000001 | NULL | Sleep | 2022-10-28 14:00:00 | 2093 | | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL |
| 1 | 0 | 0 | 3973 | event_scheduler | localhost | NULL | NULL | Daemon | 2022-10-28 13:44:05 | 3048 | Waiting for next activation | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL |
+----+---------+-----------+----------+-----------------+----------------------+--------------+------+---------+---------------------+------+-----------------------------+--------------------+------------------+------------------------+--------------+--------------+------+------+----------------------------------------------+-------+
3 rows in set (Elapsed: 00:00:00.00)
16、支持的HINT的参数
gbase> select * from information_schema.session_variables where session_level=1 and writeable=1;
+--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-----------+
| VARIABLE_NAME | VARIABLE_VALUE | SESSION_LEVEL | WRITEABLE |
+--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-----------+
| GCLUSTER_LOG_INCLUDE_SQL | 1 | 1 | 1 |
| GBASE_HDFS_NAMENODES | | 1 | 1 |
| _T_GCLUSTER_HASH_REDIST_PRIMARY_SUFFIX | 1 | 1 | 1 |
| RECORD_SQL | OFF | 1 | 1 |
| GCLUSTER_LOCK_LEVEL | 2 | 1 | 1 |
| BULK_INSERT_BUFFER_SIZE | 8388608 | 1 | 1 |
| _T_GCLUSTER_DBLINK_INSERT_SELECT_OPTIMIZATION | 1 | 1 | 1 |
| _GBASE_PARALLEL_NESTED_LOOP_JOIN | 1 | 1 | 1 |
| _GBASE_PRECISION_DECIMAL_EXPRESSION | 6 | 1 | 1 |
| GCLUSTER_LOCK_TIMEOUT | 0 | 1 | 1 |
| GCLUSTER_DDL_PARALLEL_EXECUTE | 0 | 1 | 1 |
| GCLUSTER_NODE_STATUS_LIST | | 1 | 1 |
| _GBASE_OR_RECURSION_DEPTH | 10 | 1 | 1 |
| CHARACTER_SET_RESULTS | utf8 | 1 | 1 |
| GCLUSTER_KAFKA_MAX_MESSAGE_SIZE | 100000000 | 1 | 1 |
| CHARACTER_SET_CONNECTION | utf8 | 1 | 1 |
| _GBASE_OPTIMIZER_DELAY_CORRELATED_SUBQUERY_SCAN | OFF | 1 | 1 |
| SQL_BUFFER_RESULT | OFF | 1 | 1 |
| _GBASE_OLAP_MAX_MAT_FILES | 10000 | 1 | 1 |
| MAX_SORT_LENGTH | 1024 | 1 | 1 |
| CHARACTER_SET_SERVER | utf8 | 1 | 1 |
| BIG_TABLES | OFF | 1 | 1 |
| _GBASE_INSERT_MALLOC_SIZE_LIMIT | 10240 | 1 | 1 |
| COLLATION_DATABASE | utf8_general_ci | 1 | 1 |
| PSEUDO_THREAD_ID | 7 | 1 | 1 |
| GCLUSTER_LOADER_MAX_DATA_PROCESSORS | 16 | 1 | 1 |
| _T_GCLUSTER_UPDATE_SCALAR_TO_CONST | 1 | 1 | 1 |
| RANGE_ALLOC_BLOCK_SIZE | 4096 | 1 | 1 |
| GCLUSTER_LOG_LEVEL | 3 | 1 | 1 |
| AUTO_INCREMENT_OFFSET | 1 | 1 | 1 |
| GBASE_TRACE_MAX_SIZE | 1048576 | 1 | 1 |
| LOAD_DIRTY_DATA_SIZE | 0 | 1 | 1 |
| JOIN_BUFFER_SIZE | 131072 | 1 | 1 |
| _GBASE_QUERY_PATH | OFF | 1 | 1 |
| SQL_LOW_PRIORITY_UPDATES | OFF | 1 | 1 |
| LOW_PRIORITY_UPDATES | OFF | 1 | 1 |
| GCLUSTER_SUPPORT_HASH_REDIST_COMBINER | 0 | 1 | 1 |
| _GCLUSTER_ORDER_BY_WITH_FIXED_ORDER | 0 | 1 | 1 |
| SQL_BIG_SELECTS | ON | 1 | 1 |
| MAX_ERROR_COUNT | 64 | 1 | 1 |
| MAX_DELAYED_THREADS | 20 | 1 | 1 |
| SYNC_FRM | ON | 1 | 1 |
| GCLUSTER_SHRINK_TO_REBALANCE | OFF | 1 | 1 |
| SQL_LOG_BIN | ON | 1 | 1 |
| LOAD_TRX_DATA_SIZE | 0 | 1 | 1 |
| GBASE_LOADER_CHARSET_CONVERT | 2 | 1 | 1 |
| _GBASE_OPTIMIZER_PUSH_CONDITION | 3 | 1 | 1 |
| LOG_WARNINGS | 1 | 1 | 1 |
| _GBASE_JOINED_THRESHOLD | 0 | 1 | 1 |
| _GBASE_ENABLE_HASHTREE | ON | 1 | 1 |
| _GBASE_ONE_PASS_UNION | 1 | 1 | 1 |
| MULTI_RANGE_COUNT | 256 | 1 | 1 |
| LC_TIME_NAMES | en_US | 1 | 1 |
| GBASE_HDFS_AUTH_MODE | Simple | 1 | 1 |
| MAX_HEAP_TABLE_SIZE | 16777216 | 1 | 1 |
| _GBASE_DUP_COL_NAME_CHECK_STRICT | OFF | 1 | 1 |
| SQL_AUTO_IS_NULL | ON | 1 | 1 |
| MAX_INSERT_DELAYED_THREADS | 20 | 1 | 1 |
| _GBASE_DATE_FUNCTION_MODE | 0 | 1 | 1 |
| NET_RETRY_COUNT | 10 | 1 | 1 |
| GCLUSTER_SINGLE_HASH_NODE_OPTIMIZE | 1 | 1 | 1 |
| GCLUSTER_DBLINK_ORCL_CASE_SENSITIVE | 0 | 1 | 1 |
| _GBASE_PARALLEL_GROUP_LIMIT | ON | 1 | 1 |
| RAND_SEED2 | | 1 | 1 |
| LONG_QUERY_TIME | 10.000000 | 1 | 1 |
| GBASE_TRUNCATE_NANOSECOND | OFF | 1 | 1 |
| _GBASE_OLAP_MAT_MODE | 0 | 1 | 1 |
| OPTIMIZER_SWITCH | index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on | 1 | 1 |
| GBASE_TO_NUMBER_STR2DEC | OFF | 1 | 1 |
| SQL_MODE | PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH | 1 | 1 |
| _GBASE_FUNC_COMPATIBLE_MODE | OFF | 1 | 1 |
| GCLUSTER_INSERT_SINGLEGROUPPART_OPTIMIZE | 0 | 1 | 1 |
| _GCLUSTER_OPTIMIZER_PUSH_CONDITION | 1 | 1 | 1 |
| _T_GCLUSTER_FOLD_TREE_OPTIMIZE | 1 | 1 | 1 |
| GBASE_HDFS_PORT | 0 | 1 | 1 |
| CHARACTER_SET_FILESYSTEM | binary | 1 | 1 |
| _GBASE_PARALLEL_MTABLE | 1 | 1 | 1 |
| TIME_FORMAT | %H:%i:%s | 1 | 1 |
| GCLUSTER_SUPPORT_BINARY | 1 | 1 | 1 |
| NET_WRITE_TIMEOUT | 1000000 | 1 | 1 |
| GBASE_ENABLE_HDFS_SSO | ON | 1 | 1 |
| MAX_LENGTH_FOR_SORT_DATA | 1024 | 1 | 1 |
| GCLUSTER_KAFKA_PRIMARYKEY_CAN_BE_NULL | 0 | 1 | 1 |
| GBASE_GLOBAL_VARIABLE_PERSISTENT | 0 | 1 | 1 |
| BINLOG_FORMAT | STATEMENT | 1 | 1 |
| GCLUSTER_CROSSJOIN_USE_HASH_DISTRIBUTION | 1 | 1 | 1 |
| _T_GCLUSTER_ONLY_FULL_GROUP_BY_PLAN | 1 | 1 | 1 |
| GCLUSTER_IGNORE_PRIMARY_FOREIGN_SCHEMA | OFF | 1 | 1 |
| OPTIMIZER_PRUNE_LEVEL | 1 | 1 | 1 |
| CHARACTER_SET_SORT | binary | 1 | 1 |
| MIN_EXAMINED_ROW_LIMIT | 0 | 1 | 1 |
| COMPLETION_TYPE | 0 | 1 | 1 |
| _T_GCLUSTER_IN_NONCOR_SUBQUERY_OPTIMIZE | 0 | 1 | 1 |
| _GBASE_SSL_CIPHER_LIST | | 1 | 1 |
| READ_BUFFER_SIZE | 131072 | 1 | 1 |
| GCLUSTER_STATISTICS_TARGET | 25 | 1 | 1 |
| QUERY_CACHE_WLOCK_INVALIDATE | OFF | 1 | 1 |
| GBASE_DECIMAL_CALCULATION | OFF | 1 | 1 |
| QUERY_CACHE_TYPE | OFF | 1 | 1 |
| _GBASE_OPTIMIZER_HAVING | ON | 1 | 1 |
| GCLUSTER_INSERTSELECT_USE_VALUES_OPTIMIZE | 0 | 1 | 1 |
| SCN | 0 | 1 | 1 |
| _T_GCLUSTER_OPTIMIZE_HASH_REDISTRIBUTE_HA | 1 | 1 | 1 |
| TABLE_TYPE | EXPRESS | 1 | 1 |
| PRELOAD_BUFFER_SIZE | 32768 | 1 | 1 |
| _T_GCLUSTER_HASH_CORRSUB_RELATED_MULTI_OUTER_TABLE | 0 | 1 | 1 |
| OLD_PASSWORDS | OFF | 1 | 1 |
| SQL_MAX_JOIN_SIZE | 18446744073709551615 | 1 | 1 |
| DATE_FORMAT | %Y-%m-%d | 1 | 1 |
| _T_GCLUSTER_USE_REDIST_HA_FOR_INSERT | 1 | 1 | 1 |
| KEEP_FILES_ON_CREATE | OFF | 1 | 1 |
| _T_GCLUSTER_DISTINCT_MULTI_REDIST | 0 | 1 | 1 |
| TX_ISOLATION | REPEATABLE-READ | 1 | 1 |
| _T_GCLUSTER_DIRECT_INSERT | 1 | 1 | 1 |
| AUTOCOMMIT | ON | 1 | 1 |
| _T_GCLUSTER_USE_NEW_JOIN_TRAVERSE_OPTIMIZE | 1 | 1 | 1 |
| GCLUSTER_ORDER_BY_LIMIT_OFFSET_OPTIMIZE | 0 | 1 | 1 |
| GCLUSTER_KAFKA_CONSUMER_ESCAPE_ZERO | 0 | 1 | 1 |
| GCLUSTER_DBLINK_OPTIMIZE | 0 | 1 | 1 |
| TMP_TABLE_SIZE | 16777216 | 1 | 1 |
| _GBASE_DC_WINDOW_SIZE | 256 | 1 | 1 |
| SYS_CONNECT_BY_PATH_MAX_LEN | 1024 | 1 | 1 |
| SQL_BIG_TABLES | OFF | 1 | 1 |
| LAST_INSERT_ID | 0 | 1 | 1 |
| _GBASE_OPTIMIZER_AGGR_DISTINCT | 1 | 1 | 1 |
| MAX_SP_RECURSION_DEPTH | 0 | 1 | 1 |
| GBASE_HDFS_KEYTAB | | 1 | 1 |
| _GBASE_OPTIMIZER_OUTERJOIN_CONDITION | ON | 1 | 1 |
| SQL_WARNINGS | OFF | 1 | 1 |
| OLD_ALTER_TABLE | OFF | 1 | 1 |
| _T_GCLUSTER_USER_DEFINED_JOIN_HINT | 0 | 1 | 1 |
| GCLUSTER_CONNECT_NET_WRITE_TIMEOUT | 1000000 | 1 | 1 |
| GBASE_HDFS_CACHEFILE | | 1 | 1 |
| GBASE_KAFKA_BROKER_VERSION | | 1 | 1 |
| GBASE_EXPORT_DIRECTORY | ON | 1 | 1 |
| _GBASE_HASH_PART_SAMPLE_PERCENT | 1 | 1 | 1 |
| GBASE_PARALLEL_AUTO_ESTIMATE_OPTIMIZE | 0 | 1 | 1 |
| _GBASE_SAMPLE_MAX_WIDTH | 10000 | 1 | 1 |
| AUTO_INCREMENT_INCREMENT | 1 | 1 | 1 |
| _T_GCLUSTER_FOLD_UNION_OPTIMIZE | 0 | 1 | 1 |
| _GBASE_IMPLICIT_TYPE_CONVERSION_CHECKING | OFF | 1 | 1 |
| _GBASE_HASH_INDEX_JOIN_MATCH_TABLE_ROWS | 2000 | 1 | 1 |
| ENGINE_CONDITION_PUSHDOWN | ON | 1 | 1 |
| MAX_JOIN_SIZE | 18446744073709551615 | 1 | 1 |
| GBASE_SQL_TRACE | OFF | 1 | 1 |
| _GBASE_CACHING_LEVEL | 1 | 1 | 1 |
| _GBASE_ONE_PASS_HASH_JOIN | 0 | 1 | 1 |
| _GBASE_PARALLEL_READ_DATA | OFF | 1 | 1 |
| _GBASE_SIS_SEND_BUFFER_SIZE | 65536 | 1 | 1 |
| _T_GCLUSTER_BROADCAST_FOR_REDIST_FAIL | 0 | 1 | 1 |
| _GBASE_PARALLEL_MERGE_TAILDC | 0 | 1 | 1 |
| _GBASE_ONE_PASS_OR | 1 | 1 | 1 |
| GSSYS_SORT_BUFFER_SIZE | 8388608 | 1 | 1 |
| GBASE_LOADER_MAX_LINE_LENGTH | 4194304 | 1 | 1 |
| _T_GCLUSTER_SHRINK_LONG_ALIAS | 1 | 1 | 1 |
| _GBASE_HASH_PART_SAMPLE | 0 | 1 | 1 |
| _T_GCLUSTER_FROM_AND_UNCOR_SUBQUERY_INCLUDING_LIMIT | 1 | 1 | 1 |
| UPDATABLE_VIEWS_WITH_LIMIT | YES | 1 | 1 |
| _T_GCLUSTER_FOLD_TREE_OPTIMIZE_NEW | 0 | 1 | 1 |
| TRANSACTION_ALLOC_BLOCK_SIZE | 8192 | 1 | 1 |
| _GBASE_HASH_PART_CACHE_TIME | 86400 | 1 | 1 |
| _T_GCLUSTER_ADD_LIMIT_IN_EXISTS_OPTIMIZATION | 1 | 1 | 1 |
| INSERT_ID | 0 | 1 | 1 |
| SQL_QUOTE_SHOW_CREATE | ON | 1 | 1 |
| _T_GCLUSTER_CORR_PUSH_FROM | 0 | 1 | 1 |
| QUERY_ALLOC_BLOCK_SIZE | 8192 | 1 | 1 |
| GBASE_EXPORT_WRITE_TIMEOUT | 300 | 1 | 1 |
| GCLUSTER_NODE_EXEC_RETRY_TIMES | 0 | 1 | 1 |
| _GBASE_OLAP_SPLIT_MODE | 0 | 1 | 1 |
| NET_READ_TIMEOUT | 1000000 | 1 | 1 |
| INTERACTIVE_TIMEOUT | 1000000 | 1 | 1 |
| COLLATION_SERVER | utf8_general_ci | 1 | 1 |
| GBASE_HDFS_PROTOCOL | HTTP | 1 | 1 |
| GCLUSTER_HASH_REDISTRIBUTE_JOIN_OPTIMIZE | 2 | 1 | 1 |
| GCLUSTER_KAFKA_CONSUME_BATCH | 1000 | 1 | 1 |
| GCLUSTER_JOIN_ESTIMATE_COUNT_OPTIMIZE | 0 | 1 | 1 |
| GCLUSTER_HASH_REDIST_THRESHOLD_ROW | 0 | 1 | 1 |
| _GBASE_BSI_CHECK_DISABLE | OFF | 1 | 1 |
| _GBASE_HASH_PART_SAMPLE_METHOD | 0 | 1 | 1 |
| GCLUSTER_CONNECT_NET_READ_TIMEOUT | 1000000 | 1 | 1 |
| _GBASE_ENABLE_HASH_INDEX_JOIN | OFF | 1 | 1 |
| GCLUSTER_INSERT_VALUE_MODE_RETRY | 0 | 1 | 1 |
| _GBASE_HDFS_USERAGENT | curl/7.43.0 | 1 | 1 |
| GBASE_LOADER_LAST_TASK_ID | 0 | 1 | 1 |
| _GBASE_OPTIMIZER_SUBSTR_TO_LIKE | ON | 1 | 1 |
| COLLATION_CONNECTION | utf8_general_ci | 1 | 1 |
| DEFAULT_WEEK_FORMAT | 0 | 1 | 1 |
| TRANSACTION_PREALLOC_SIZE | 4096 | 1 | 1 |
| GBASE_HDFS_CLIENT_TIMEOUT | 600 | 1 | 1 |
| GCLUSTER_KAFKA_LOCAL_QUEUE_SIZE | 200000 | 1 | 1 |
| STORAGE_ENGINE | EXPRESS | 1 | 1 |
| _T_GCLUSTER_UNION_REDIST_DISTINCT | 0 | 1 | 1 |
| TIME_ZONE | +08:00 | 1 | 1 |
| MAX_TMP_TABLES | 32 | 1 | 1 |
| _GBASE_ADJUST_COMPLEX_SCAN_WEIGHT | 1 | 1 | 1 |
| SQL_SAFE_UPDATES | OFF | 1 | 1 |
| _GBASE_HDFS_RPCCONFIG | | 1 | 1 |
| GCLUSTER_FOLD_SELECT_TREE_OPTIMIZE | 1 | 1 | 1 |
| GCLUSTER_KAFKA_PARALLEL_COMMIT | 1 | 1 | 1 |
| PROFILING | OFF | 1 | 1 |
| _T_GCLUSTER_PUSH_DOWN_CONST_COND_TO_TMP_TABLE | 0 | 1 | 1 |
| TIMESTAMP | 1678065560 | 1 | 1 |
| CHARACTER_SET_CLIENT | utf8 | 1 | 1 |
| _T_GCLUSTER_EXPLAIN_DISPLAY_COST | 2 | 1 | 1 |
| _GBASE_AUTOEXTEND_MODE | 0 | 1 | 1 |
| GCLUSTER_EXECUTOR_DEBUG | 0 | 1 | 1 |
| _T_GBASE_NEW_WINDOW_FUNCTION_SUPPORT | OFF | 1 | 1 |
| _GBASE_SUBQUERY_CACHE_BUFFER_MODE | 0 | 1 | 1 |
| _T_GCLUSTER_LIMIT_OPTIMIZE | 1 | 1 | 1 |
| GBASE_EXPORT_TRUNCATE_MODE | 0 | 1 | 1 |
| GCLUSTER_EMPTY_RESULT_SET_OPTIMIZE | 0 | 1 | 1 |
| GBASE_DISABLE_ENCRYPT | OFF | 1 | 1 |
| AUTO_TRACE | OFF | 1 | 1 |
| _T_GCLUSTER_OPTIMIZE_USE_INSERT_PREPARE_STEP | 0 | 1 | 1 |
| GCLUSTER_COST_BASED_PLANNER | 0 | 1 | 1 |
| _T_GCLUSTER_MERGE_SUPPORT_SUBQUERY | 1 | 1 | 1 |
| GCLUSTER_KAFKA_CONSUMER_OUTPUT_CHARSET_NAME | | 1 | 1 |
| _GBASE_FILE_SYNC_LEVEL | ON | 1 | 1 |
| GCLUSTER_KAFKA_CONSUMER_SPECIAL_USE_CHARSET_NAME | | 1 | 1 |
| _T_GCLUSTER_MULTI_DISTRIBUTION_REDIST_POLICY | 1 | 1 | 1 |
| GBASE_HBASE_SERVER_NAME | | 1 | 1 |
| _T_GCLUSTER_PUSH_DOWN_COND_OF_RIGHT_TABLE_FOR_LEFT_JOIN | 1 | 1 | 1 |
| GCLUSTER_IPV4_DBLINK_INSERT | 1 | 1 | 1 |
| NEW | OFF | 1 | 1 |
| _GBASE_IMPLICIT_TYPE_CONVERSION_MODE | 0 | 1 | 1 |
| RAND_SEED1 | | 1 | 1 |
| _T_GCLUSTER_NOCOPY_EXTRA_STEP_FOR_DML | 1 | 1 | 1 |
| FOREIGN_KEY_CHECKS | ON | 1 | 1 |
| MAX_ALLOWED_PACKET | 67108864 | 1 | 1 |
| _GBASE_SORT_ROWID_AFTER_JOIN | 1 | 1 | 1 |
| _T_GCLUSTER_INNER_COND | 1 | 1 | 1 |
| _GBASE_OPTIMIZER_IN_SUBSELECT | ON | 1 | 1 |
| GCLUSTER_SQL_STATISTICS | 0 | 1 | 1 |
| _GBASE_DISABLE_CONDITION_REORDER | 0 | 1 | 1 |
| GCLUSTER_HASH_REDISTRIBUTE_EXPRESSION_GROUPBY_OPTIMIZE | 1 | 1 | 1 |
| GCLUSTER_HASH_REDISTRIBUTE_GROUPBY_OPTIMIZE | 1 | 1 | 1 |
| _GBASE_PARALLEL_GROUP_USE_EXPRESSION | 0 | 1 | 1 |
| QUERY_PREALLOC_SIZE | 8192 | 1 | 1 |
| _T_GCLUSTER_OLAP_DIRECT | 1 | 1 | 1 |
| GCLUSTER_KAFKA_RESULT_CHECK | 0 | 1 | 1 |
| _GBASE_HYBRID_STORE_LIMIT | 100 | 1 | 1 |
| _T_GCLUSTER_REUSE_TMP_TABLE_OPTIMIZE | 0 | 1 | 1 |
| GBASE_KAFKA_KEYTAB | | 1 | 1 |
| _T_GCLUSTER_TPCH_OPTIMIZE | 0 | 1 | 1 |
| GROUP_CONCAT_MAX_LEN | 1024 | 1 | 1 |
| _GBASE_HYBRID_HASH_JOIN | 1 | 1 | 1 |
| _T_GCLUSTER_NO_SELECT_WITH_PROC | 1 | 1 | 1 |
| _T_GCLUSTER_GENERATE_INTERIM_TABLE_POLICY | 1 | 1 | 1 |
| _T_GCLUSTER_KAFKA_NULL_TRANSFORM | 0 | 1 | 1 |
| GCLUSTER_COUNT_OPTIMIZE | 1 | 1 | 1 |
| _GCLUSTER_OPTIMIZER_COUNT_DISTINCT | 0 | 1 | 1 |
| _GBASE_HYBRID_STORE_GROUP | 0 | 1 | 1 |
| SQL_LOG_OFF | OFF | 1 | 1 |
| _GBASE_PARALLEL_SELECT_SEND | ON | 1 | 1 |
| GCLUSTER_AUTOSTATS_MODE | 0 | 1 | 1 |
| MAX_USER_CONNECTIONS | 0 | 1 | 1 |
| GCLUSTER_UNION_ALL_LIMIT_OPTIMIZE | 1 | 1 | 1 |
| _T_GCLUSTER_GREATEST_FUNC_EXPAND | 0 | 1 | 1 |
| GBASE_KAFKA_PRINCIPAL | | 1 | 1 |
| GCLUSTER_DDL_UNDO_ENABLE | 0 | 1 | 1 |
| GCLUSTER_HASH_JOIN_COMPLEX_OPTIMIZE | 1 | 1 | 1 |
| CORRELATED_SUBSELECT_AUTO_OPTIMIZE | ON | 1 | 1 |
| _T_GCLUSTER_DBLINK_CLEAR_SYNTAX_CONSTRAINTS | 0 | 1 | 1 |
| _T_GCLUSTER_GROUP_BY_EXT_OPTIMIZATION | 0 | 1 | 1 |
| _T_GCLUSTER_MULTI_CORRQUERY_OPTIMIZE | 0 | 1 | 1 |
| _T_GCLUSTER_HA_TEST_CMD | ha_normal | 1 | 1 |
| GBASE_SHOW_TRACE | OFF | 1 | 1 |
| GCLUSTER_UNION_OPTIMIZE | 1 | 1 | 1 |
| _T_GCLUSTER_INSERT_SELECT_ORDERBY_OPTIMIZE | 1 | 1 | 1 |
| GBASE_PARALLEL_AUTO_ESTIMATE_NUMBER | 16 | 1 | 1 |
| _T_GCLUSTER_EXPR_HASH_JOIN_OPTIMIZE | 1 | 1 | 1 |
| GCLUSTER_STATISTICS_SAMPLING_THRESHOLD | 20000 | 1 | 1 |
| _GBASE_DATE_FUNC_TYPE | 1 | 1 | 1 |
| _T_GCLUSTER_HASH_REDIST_OLAP_OPTIMIZE | 1 | 1 | 1 |
| _GCLUSTER_CASE_WHEN_IS_HASH | 0 | 1 | 1 |
| _GBASE_PARALLEL_LOAD_DC | ON | 1 | 1 |
| _GCLUSTER_DDL_DML_DEBUG_MODE | 0 | 1 | 1 |
| _T_GCLUSTER_CASE_WHEN_SUPPORT_INSUBQUERY | 0 | 1 | 1 |
| _T_GCLUSTER_OPTIMIZE_INSERT_SELECT_HASH_REDISTRIBUTE | 1 | 1 | 1 |
| _T_GCLUSTER_HAVING_WITHOUT_GROUP_BY | 0 | 1 | 1 |
| GBASE_TYPE_CONVERSION_WARN2ERR | OFF | 1 | 1 |
| DATETIME_FORMAT | %Y-%m-%d %H:%i:%s | 1 | 1 |
| _GBASE_PARALLEL_INSERTSELECT_MODE | 1 | 1 | 1 |
| _T_GCLUSTER_SWAP_JOIN_COND_OPTIMIZE | 1 | 1 | 1 |
| NET_BUFFER_LENGTH | 16384 | 1 | 1 |
| _T_GCLUSTER_TEMP_TABLE_TRACE | 0 | 1 | 1 |
| GCLUSTER_LOAD_REBALANCE_SEED | 5 | 1 | 1 |
| GBASE_INSERTSELECT_PARALLEL_FOREVER | 0 | 1 | 1 |
| SQL_NOTES | ON | 1 | 1 |
| _T_GCLUSTER_AGG_DISTINCT_REDIST_OPTIMIZE_WITH_GROUPBY | 0 | 1 | 1 |
| _T_GCLUSTER_SINGLE_SEGMENT_CLUSTER_OPTIMIZATION | 0 | 1 | 1 |
| GCLUSTER_KAFKA_DATA_BUF_SIZE | 0 | 1 | 1 |
| IDENTITY | 0 | 1 | 1 |
| _T_GCLUSTER_MAX_VALUE_OF_LEFT_TABLE_IN_START_SCHEMA | 10000 | 1 | 1 |
| _GBASE_TRANSACTION_DISABLE | 1 | 1 | 1 |
| _GBASE_PARALLEL_AGGR_MODE | 0 | 1 | 1 |
| GCLUSTER_SPECIAL_CORRELATED_OPTIMIZE | 1 | 1 | 1 |
| GBASE_LOADER_WILDCARD_SWITCH | ON | 1 | 1 |
| SQL_LOG_UPDATE | ON | 1 | 1 |
| GBASE_LOADER_PARALLEL_DEGREE | 0 | 1 | 1 |
| GCLUSTER_USE_SPECIAL_MATERIALIZED_TABLE | 1 | 1 | 1 |
| _T_GCLUSTER_EXPLAIN_MODE | 1 | 1 | 1 |
| GCLUSTER_SUFFIX_CONSISTENCY_CHECK | 1 | 1 | 1 |
| GBASE_OPTIMIZER_BETWEEN_JOIN | 1 | 1 | 1 |
| SORT_BUFFER_SIZE | 2097144 | 1 | 1 |
| _T_GCLUSTER_REWRITE_TIME_FUNCTION | 1 | 1 | 1 |
| PROFILING_HISTORY_SIZE | 15 | 1 | 1 |
| _T_GCLUSTER_VOLATILE_RESULT_STEP | 1 | 1 | 1 |
| GCLUSTER_DML_DDL_PROXY_SWITCH | 0 | 1 | 1 |
| _T_GCLUSTER_TABLE_NAME_CONFLICT | 1 | 1 | 1 |
| _T_GCLUSTER_HASH_REDIST_DISTINCT_OPTIMIZE | 1 | 1 | 1 |
| _GBASE_MULTI_PASS_HASH_JOIN | 1 | 1 | 1 |
| INIT_SCN_NUMBER | 0 | 1 | 1 |
| _T_GCLUSTER_UNION_REDIST_OPTIMIZE | 0 | 1 | 1 |
| _T_GCLUSTER_SCALAR_OBSERVOR | 1 | 1 | 1 |
| GCLUSTER_KAFKA_LOADER_MAX_START_COUNT | 20 | 1 | 1 |
| _T_GCLUSTER_WANT_TO_SAVE_DEBUG_FILES | 0 | 1 | 1 |
| GBASE_HDFS_MAX_RETRY | 3 | 1 | 1 |
| _GBASE_ADD_MONTHS_MODE | 0 | 1 | 1 |
| _T_GCLUSTER_USE_NEW_DUAL | 1 | 1 | 1 |
| _T_GCLUSTER_OPTIMIZE_CHAIN_CONDITION | 1 | 1 | 1 |
| GSSYS_REPAIR_THREADS | 1 | 1 | 1 |
| _T_GCLUSTER_CHECK_THREAD_STACK_OVERFLOW | 1 | 1 | 1 |
| _GBASE_OPTIMIZER_OR_TREE | 1 | 1 | 1 |
| GCLUSTER_KAFKA_USER_ALLOWED_MAX_LATENCY | 10000 | 1 | 1 |
| GCLUSTER_QUERY_PARALLEL_EXECUTE | 0 | 1 | 1 |
| GCLUSTER_STARSCHEMA_OPTIMIZE | 0 | 1 | 1 |
| GCLUSTER_LOADER_MIN_CHUNK_SIZE | 67108864 | 1 | 1 |
| _GBASE_EXCLUDE_SELECT_AFTER_PUSH | ON | 1 | 1 |
| GCLUSTER_REBALANCING_UPDATE_STATUS_ON_DROP_TABLE | ON | 1 | 1 |
| GCLUSTER_STRICT_EVAL_TEMP_TABLE | 0 | 1 | 1 |
| _T_GCLUSTER_TPCDS_OPTIMIZE | 0 | 1 | 1 |
| _GCLUSTER_SUPPORT_OUTFILE_WITH_TABLE_HEAD_CASE_SENSITIVE | 0 | 1 | 1 |
| GCLUSTER_KAFKA_BATCH_COMMIT_DML_COUNT | 100000 | 1 | 1 |
| GBASE_LOADER_CHECK_CHARSET | OFF | 1 | 1 |
| GBASE_LOADER_READ_TIMEOUT | 300 | 1 | 1 |
| _GBASE_HASH_PART_TWICE | 0 | 1 | 1 |
| _GBASE_RESMGR_MEMCTRL_BYPASS | ON | 1 | 1 |
| GCLUSTER_DELAYED_GROUP_BY_OPTIMIZE | 0 | 1 | 1 |
| _T_GCLUSTER_AGG_DISTINCT_REDIST_OPTIMIZE | 1 | 1 | 1 |
| GCLUSTER_STARSCHEMA_JOIN_ESTIMATE_OPTIMIZE | 1 | 1 | 1 |
| GSSYS_STATS_METHOD | nulls_unequal | 1 | 1 |
| _T_GCLUSTER_HASH_REDISTRIBUTE_GROUPBY_ON_MULTIPLE_EXPRESSION | 0 | 1 | 1 |
| GCLUSTER_RES_SEND_BATCH | 1000 | 1 | 1 |
| _GBASE_IN_SUBQUERY_RESULT_THRESHOLD | 10000000 | 1 | 1 |
| _T_GCLUSTER_MULTI_JOIN_CONDITION_OPTIMIZE | 0 | 1 | 1 |
| DIV_PRECISION_INCREMENT | 4 | 1 | 1 |
| _T_GCLUSTER_SUPPORT_CTE | 0 | 1 | 1 |
| GCLUSTER_CONNPOOL_FILTER_VAR | 1 | 1 | 1 |
| GCLUSTER_KAFKA_IGNORE_IF_TABLE_NOT_EXIST | 0 | 1 | 1 |
| MAX_SEEKS_FOR_KEY | 18446744073709551615 | 1 | 1 |
| GBASE_SEND_RESULT_MODE | ON | 1 | 1 |
| _GBASE_ENABLE_HDFS_USERAGENT | OFF | 1 | 1 |
| _T_GCLUSTER_INSERT_NOCOPY_WITH_OUT_PREPARE_STEP | 1 | 1 | 1 |
| _GBASE_HASH_PART_CACHE_CHANGE_NO | 1 | 1 | 1 |
| _GBASE_PARALLEL_SORT_LIMIT | 100000 | 1 | 1 |
| GCLUSTER_SAMPLE_POOL_MAXSIZE | 200000 | 1 | 1 |
| GBASE_MAX_ALLOWED_LEVEL | 1024 | 1 | 1 |
| GBASE_LOADER_BUFFER_COUNT | 16 | 1 | 1 |
| READ_RND_BUFFER_SIZE | 262144 | 1 | 1 |
| SQL_SELECT_LIMIT | 18446744073709551615 | 1 | 1 |
| GCLUSTER_PARALLEL_DISTRIBUTION_NUMBER | 0 | 1 | 1 |
| GBASE_LOADER_LINE_LENGTH | 4194304 | 1 | 1 |
| GCLUSTER_KAFKA_IGNORE_POS_FIELD | 0 | 1 | 1 |
| OPTIMIZER_SEARCH_DEPTH | 62 | 1 | 1 |
| GCLUSTER_ANALYZE_RELATIVE_ERROR | 25 | 1 | 1 |
| _GBASE_REP_CHECK_DC_ACK | OFF | 1 | 1 |
| _GBASE_UPDATE_SAVE_DC_BUFFER | 1024 | 1 | 1 |
| _GBASE_OPTIMIZER_SUBSELECT_MATERIALIZE | ON | 1 | 1 |
| GCLUSTER_SEND_CLIENT_DATA_TIMEOUT | 30 | 1 | 1 |
| _GBASE_RESULT_THRESHOLD | 137438953472 | 1 | 1 |
| GCLUSTER_DQL_STATISTIC_THRESHOLD | 0 | 1 | 1 |
| GBASE_HDFS_TOKEN_RENEW_INTERVAL | 3600 | 1 | 1 |
| GBASE_AVRO_BLOCK_LIMIT | 8388608 | 1 | 1 |
| _GBASE_HASH_PART_SAMPLE_TOP | 5 | 1 | 1 |
| WAIT_TIMEOUT | 1000000 | 1 | 1 |
| _GBASE_OPTIMIZER_MULTI_DIM_PROJECTION | ON | 1 | 1 |
| _GBASE_HINT_ERROR_LEVEL | 0 | 1 | 1 |
| _T_GCLUSTER_SCALAR_SUBQUERY_EXEC_MODE | 0 | 1 | 1 |
| _GBASE_CHECK_PASSWORD_FORMAT | OFF | 1 | 1 |
| _T_GCLUSTER_DBLINK_GENERATE_INTERIM_TABLE_POLICY | 1 | 1 | 1 |
| _GBASE_HASH_PART_TWICE_TOP | 5 | 1 | 1 |
| GBASE_HDFS_PRINCIPAL | | 1 | 1 |
| GBASE_HYBRID_STORE | 1 | 1 | 1 |
| GBASE_PARALLEL_DEGREE | 0 | 1 | 1 |
| GBASE_FAST_UPDATE | OFF | 1 | 1 |
| GBASE_PARALLEL_EXECUTION | OFF | 1 | 1 |
| GCLUSTER_SQL_EXEC_RETRY_TIMES | 0 | 1 | 1 |
| GBASE_CACHING_SHA2_PASSWORD | OFF | 1 | 1 |
| _GBASE_USE_TRASH_CAN | 1 | 1 | 1 |
| GCLUSTER_HDFS_NFS_GATEWAY | OFF | 1 | 1 |
| GCLUSTER_OPTIMIZER_GATHER_PATH_FOR_AGG_COMPUTE | 0 | 1 | 1 |
| UNIQUE_CHECKS | ON | 1 | 1 |
| CHARACTER_SET_DATABASE | utf8 | 1 | 1 |
| _GBASE_ONE_PASS_HASH_GROUP | 1 | 1 | 1 |
| GCLUSTER_DBLINK_DIRECT_DATA_EXCHANGE | 1 | 1 | 1 |
| GBASE_PARALLEL_THRESHOLD | 10000 | 1 | 1 |
| GBASE_OPTIMIZER_QUERY_REWRITE | 0 | 1 | 1 |
| _GBASE_USE_NEW_MTABLE | ON | 1 | 1 |
+--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-----------+
399 rows in set (Elapsed: 00:00:00.01)