返回首页

gbase数据、南大通用产品文档:GBase8agbase_parallel_degree

更新日期:2024年09月11日

功能
这个参数用于设置控制SQL 执行的并行度
(并行线程数)

如果不设定该参数值,
则该参数的默认值是0
(0 表示用默认并行度,
默认并行度取值是线程池最大可用
资源数的一半)。如果设定该参数值,则最小值取值为1。
表6- 65 参数值范围说明表
默认值
最小值
最大值
0
1
线程池最大可用线程数

语法格式
RENAME TABLE [database_name.]old_table_name TO [database_name.]
new_table_name;
参数说明

database_name:是要修改表隶属的数据库名称,可选项;省略此参数,即为
USE 后的数据库名称。

old_table_name:是表的原有名称。

new_table_name:是表的要修改后的新名称。
功能
RENAME TABLE 的功能就是将一张已经存在的表的名称修改为一个不存在的新的
表名称。
示例
示例1:更改表tx1 的名称为tx_1。

GBase UP 产品手册 5 数据库管理指南
文档版本04(2021-04-21) 南大通用数据技术股份有限公司 650
gbase>
SELECT
table_schema,table_name,table_rows
FROM
information_schema.tables
WHERE
table_schema='test' AND table_name = 'tx1';
+--------------+------------+------------+
| table_schema | table_name | table_rows |
+--------------+------------+------------+
| test | tx1 | 0 |
+--------------+------------+------------+
1 row in set
gbase> USE test;
Query OK, 0 rows affected
gbase> RENAME TABLE test.tx1 to test.tx_1;
Query OK, 0 rows affected
gbase>
SELECT
table_schema,table_name,table_rows
FROM
information_schema.tables
WHERE
table_schema='test' AND table_name = 'tx_1';
+--------------+------------+------------+
| table_schema | table_name | table_rows |
+--------------+------------+------------+
| test | tx_1 | 0 |
+--------------+------------+------------+
1 row in set

处理结果集

cursor.fetchone():这种方法提取的查询结果集的下一行,返回一个序列,没有数
据可
用时则返回空。

cursor.fetchall():
这个例程获取所有查询结果(剩余)行,
返回一个列表。
空行时
则返回
空列表。