返回首页

gbase数据、南大通用产品文档:GBase8a调整rebalance 任务优先级

更新日期:2024年09月11日

功能说明
在批量执行rebalance 操作时,可以通过修改gclusterdb.rebalancing_status 表调整单
个rebalance 任务的优先级。priority 值最小的任务先做。
语法格式
update gclusterdb.rebalancing_status set priority = where
index_name='database_name.table_name';
表4- 46 参数说明
参数名称


priority_value
Priority_value 指定的值最小的任务先做,
默认该值为5。
database_name.table_name
指定要调整优先级的表的名称,可以通

select
index_name,
status,
priority
from
gclusterdb.rebalancing_status 命令查看,
即为查询结果中index_name 列对应的
值。
操作步骤
1)设置gcluster_rebalancing_concurrent_count 值为0。
gbase> set global gcluster_rebalancing_concurrent_count = 0;
Query OK, 0 rows affected
2)执行rebalance database 命令增加rebalance 任务。
此时所有rebalance 任务都不会
开始。
gbase> rebalance database test;
Query OK, 3 rows affected
3)调整rebalance 任务的优先级。
gbase> select index_name, status, priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
358
+------------+----------+----------+
| test.t3
| STARTING |
5 |
| test.t1
| STARTING |
5 |
| test.t2
| STARTING |
5 |
+------------+----------+----------+
3 rows in set
gbase>
update
gclusterdb.rebalancing_status
set
priority
=
6
where
index_name='test.t3';
Query OK, 1 row affected
Rows matched: 1
Changed: 1
Warnings: 0
gbase>
update
gclusterdb.rebalancing_status
set
priority
=
4
where
index_name='test.t2';
Query OK, 1 row affected
Rows matched: 1
Changed: 1
Warnings: 0
gbase> select index_name, status, priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| STARTING |
4 |
+------------+----------+----------+
3 rows in set
gbase> set global gcluster_rebalancing_concurrent_count = 1;
Query OK, 0 rows affected
gbase>
select
index_name,
status,
priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| RUNNING
|
4 |
+------------+----------+----------+
3 rows in set
4)调整完之后设置gcluster_rebalancing_concurrent_count 为需要的并发数
gbase> set global gcluster_rebalancing_concurrent_count = 1;
Query OK, 0 rows affected
gbase>
select
index_name,
status,
priority
from
gclusterdb.rebalancing_status;
+------------+----------+----------+
| index_name | status
| priority |

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
359
+------------+----------+----------+
| test.t3
| STARTING |
6 |
| test.t1
| STARTING |
5 |
| test.t2
| RUNNING
|
4 |
+------------+----------+----------+
3 rows in set

No Transaction Isolation on non-logging db's
GBase 8s 不支持在非日志记录的数据库上设置事务隔离级别。

使用 CREATE TRIGGER 语句定义新触发器。CREATE TRIGGER 语句是数据定义语句,
它将称为触发操作的 SQL 语句与表上的诱发事件相关联。当发生诱发操作时,它触发存
储在数据库中的关联 SQL 语句。

GBase 8s SQL 指南:教程
南大通用数据技术股份有限公司
- 338 -
在本示例中,触发事件是引用 items 表中的 quantity 列的 UPDATE 语句。下图说明激活触
发器的 DML 操作(称为触发器事件)与触发操作之间的关系。
图: 触发事件和触发操作


CREATE TRIGGER 语句由执行下列操作的子句组成:

声明触发器名称。

指定在指定表或试图上作为触发事件的 DML 操作。

定义该事件触发器的 SQL 操作。
FOR EACH ROW 触发操作中讨论了称为 REFERENCING 子句的可选子句。
要创建触发器,使用 DB-Access 或某个 SQL API。本节描述当您在 DB-Access 中使用交互
查询语言选项输入 CREATE TRIGGER 语句时的用法。在 SQL API 中,您在语句前加上
将该语句标识为嵌入式语句的符号或关键字。