当前位置:网站首页>[maintain cluster case set] gaussdb query user space usage
[maintain cluster case set] gaussdb query user space usage
2022-06-25 11:06:00 【Hua Weiyun】
create table user_resource
(node_name text,
username name,
used_memory int,
total_memory int,
used_cpu float,
total_cpu int,
used_space bigint,
total_space bigint,
used_temp_space bigint,
total_temp_space bigint,
used_spill_space bigint,
total_spill_space bigint,
read_kbytes bigint,
write_kbytes bigint,
read_counts bigint,
write_counts bigint,
read_speed float,
write_speed float
);
create or replace function query_user()
RETURNS setof user_resource
AS $$
DECLARE
node_str text;
row record;
row_data record;
query_str text;
BEGIN
node_str := 'SELECT node_name FROM pgxc_node';
FOR row in execute(node_str) LOOP
query_str := 'EXECUTE DIRECT ON (' || row.node_name || ') ' || ''' SELECT node_name, pg_total_user_resource_info.* FROM pg_node_env,pg_total_user_resource_info ''' ;
FOR row_data IN EXECUTE(query_str) LOOP
return next row_data;
END LOOP;
END LOOP;
return;
END; $$
LANGUAGE 'plpgsql' NOT FENCED;

边栏推荐
- Kotlin implements a simple login page
- Five types of questions about network planning
- Writing wechat applet with uni app
- 金仓数据库 KingbaseES 插件force_view
- Sign up to open the third session of the "flying oar hacker marathon". It's been a long time
- Daily Mathematics Series 52: February 20
- Network protocol learning -- lldp protocol learning
- Daily 3 questions (3) - check whether integers and their multiples exist
- 一个数学难题,难倒两位数学家
- Garbage collection mechanism
猜你喜欢

软件测试 避免“试用期被辞退“指南,看这一篇就够了

一个五年北漂的技术er,根据这些年的真实经历,给应届生的一些建议

XSS attack

Detailed explanation of Android interview notes handler

c盘使用100%清理方法

【文件包含漏洞-04】经典面试题:已知某网站仅存在本地文件包含漏洞时,如何GetShell?

Advanced single chip microcomputer -- development of PCB (2)

Software testing to avoid being dismissed during the probation period

金仓KFS数据级联场景部署

看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-7
随机推荐
GaussDB others内存比较高的场景
一个五年北漂的技术er,根据这些年的真实经历,给应届生的一些建议
MCU development -- face recognition application based on esp32-cam
金仓KFS数据集中场景(多对一)部署
国信证券证券账户开户安全吗
Task03 probability theory
Socket communication principle
数组结构整理
金仓数据库 KingbaseES 插件DBMS_RANDOM
开源社邀请您参加OpenSSF开源安全线上研讨会
Upload and modify the use of avatars
SystemVerilog(十三)-枚举数据类型
Apache ShenYu 入门
从GEE中免费获取全球人类住区层 (GHSL) 数据集
垃圾回收机制
Kotlin implements a simple login page
Daily 3 questions (3) - check whether integers and their multiples exist
TASK03|概率论
视频会议一体机的技术实践和发展趋势
Shardingsphere proxy 5.0 sub database and sub table (I)