返回首页

gbase数据、南大通用产品文档:GBase8sadd memory 参数:增加共享内存(SQL 管理

更新日期:2024年09月11日

API)
随同 admin() 或 task() 函数,使用 add memory 参数来添加共享内存的虚拟部分。
语法

元素
描述
关键考虑
memory_size
以 KB 为单位的新虚拟共享内
存段的大小。
这个值必须不超过操作系统对
共享内存段大小的限制

用法
这个大小预置 SHMADD 配置参数。
这个函数等同于 onmode -a 命令。
示例
下列示例添加 500 KB 虚拟共享内存:
EXECUTE FUNCTION task("add memory","500");


pg_get_gtt_relstats(relOid)
描述:显示当前会话指定的全局临时表的基本信息。
参数:全局临时表的OID。
返回值类型:record
示例:
gbase=# select * from pg_get_gtt_relstats(74069);
relfilenode | relpages | reltuples | relallvisible | relfrozenxid | relminmxid
-------------+----------+-----------+---------------+--------------+---------
---
74069 |
58 |
13000 |
0 |
11151 |
0
(1 row)

pg_get_gtt_statistics(relOid, attnum, “::text)
描述:显示当前会话指定的全局临时表的单列统计信息。
参数:全局临时表的OID 和属性attnum。

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
563
返回值类型:record
示例:
gbase=# select * from pg_get_gtt_statistics(74069,1,''::text);
starelid | starelkind | staattnum | stainherit | stanullfrac | stawidth |
stadistinct | stakind1 | stakind2 | stakind3 | stakind4 | stakind5 | staop1 | staop2
| staop3 | staop4 | staop5 | stanumbers1 | stanumbers2 | stanumbers3 | stanu
mbers4 | stanumbers5 |
stavalues1
|
stavalues2 | stavalues3 | stavalues4 | stavalues5 | stadndistinct | staextinfo
----------+------------+-----------+------------+-------------+----------+---
----------+----------+----------+----------+----------+----------+--------+--
------+--------+--------+--------+-------------+-------------+-------------+-
-----
-------+-------------+-------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----
------------------------------------------------------------------------+----
--------+------------+------------+------------+---------------+------------
74069 | c
|
1 | f
|
0 |
4 |
-1
|
2 |
3 |
0 |
0 |
0 |
97 |
97 | 0 |
0 |
0 |
| {1}
|
|
|
|
{1,130,260,390,520,650,780,910,1040,1170,1300,1430,1560,1690,1820,1950,2080,2
210,2340,2470,2600,2730,2860,2990,3120,3250,3380,3510,3640,3770,3900,4030,416
0,4290,4420,4550,4680,4810,4940,5070,5200,5330,5460,5590,57
20,5850,5980,6110,6240,6370,6500,6630,6760,6890,7020,7150,7280,7410,7540,7670,
7800,7930,8060,8190,8320,8450,8580,8710,8840,8970,9100,9230,9360,9490,9620,97
50,9880,10010,10140,10270,10400,10530,10660,10790,10920,11050,11180,11310,114
40,1
1570,11700,11830,11960,12090,12220,12350,12480,12610,12740,12870,13000} |
|
|
|
|
0 |
(1 row)

pg_gtt_attached_pid(relOid)

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
564
描述:显示正在使用指定全局临时表的所有线程pid。
参数:全局临时表的OID。
返回值类型:record
示例:
gbase=# select * from pg_gtt_attached_pid(74069);
relid |
pid
-------+-----------------
74069 | 139648170456832
74069 | 139648123270912
(2 rows)

dbe_perf.get_global_full_sql_by_timestamp(start_timestamp
timestamp,
end_timestamp
timestamp)
描述:获取实例级的全量SQL(Full SQL)信息。
返回值类型:record
表5-67 dbe_perf.get_global_full_sql_by_timestamp 参数说明
参数
类型
描述
start_timestamp
timestamp
SQL 启动时间范围的开始时间点。
end_timestamp
timestamp
SQL 启动时间范围的结束时间点。

dbe_perf.get_global_slow_sql_by_timestamp(start_timestamp
timestamp,
end_timestamp
timestamp)
描述:获取实例级的慢SQL(Slow SQL)信息。
返回值类型:record
表5-68 dbe_perf.get_global_slow_sql_by_timestamp 参数说明
参数
类型
描述
start_timestamp
timestamp
SQL 启动时间范围的开始时

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
565
间点。
end_timestamp
timestamp
SQL 启动时间范围的结束时
间点。

statement_detail_decode(detail text, format text, pretty bool)
解析全量/慢SQL 语句中的details 字段的信息。
表5-69 statement_detail_decode 参数说明
参数
类型
描述
detail
text
SQL 语句产生的事件的集合(不可读)

format
text
解析输出格式,取值为plaintext 或json。
pretty
bool
当format 为plaintext 时,是否以优雅的格式展
示:

true 表示通过“\n”分隔事件。

false 表示通过“,”分隔事件。

pg_list_gtt_relfrozenxids()
描述:显示各会话的冻结事务xid。
pid=0 的行,显示所有会话中最老的冻结事务xid。
参数:无。
返回值类型:record
示例:
gbase=# select * from pg_list_gtt_relfrozenxids();
pid
| relfrozenxid
-----------------+--------------
139648123270912 |
11151
139648170456832 |
11155
0 |
11151
(3 rows)

GBase 8c SQL 参考手册
南大通用数据技术股份有限公司
566

node (172.168.83.11)
check topology begin