当前位置:网站首页>[维护集群案例集] GaussDB 查询用户空间使用情况
[维护集群案例集] GaussDB 查询用户空间使用情况
2022-06-25 10:47:00 【华为云】
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;

边栏推荐
- FPGA基于VGA显示字符及图片
- Is it safe to open an account with Guangzhou securities by mobile phone?
- [file inclusion vulnerability-04] classic interview question: how to getshell when a website is known to have only local file inclusion vulnerability?
- 无心剑中译伊玛·拉扎罗斯《新巨人·自由女神》
- Is it safe to speculate in stocks by mobile phone?
- 【观察】ObjectScale:重新定义下一代对象存储,戴尔科技的重构与创新
- MCU development -- face recognition application based on esp32-cam
- 输出式阅读法:把学到的知识用起来
- 金仓数据库 KingbaseES 插件force_view
- scrapy+scrapyd+gerapy 爬虫调度框架
猜你喜欢
![[200 opencv routines] 210 Are there so many holes in drawing a straight line?](/img/1e/5b8245eb1c391649c7b2783c62c2b0.png)
[200 opencv routines] 210 Are there so many holes in drawing a straight line?

Shen Lu, China Communications Institute: police open source Protocol - ofl v1.1 Introduction and Compliance Analysis

中國信通院沈瀅:字體開源協議——OFL V1.1介紹及合規要點分析

【观察】ObjectScale:重新定义下一代对象存储,戴尔科技的重构与创新

视频会议一体机的技术实践和发展趋势

Opencv learning (I) -- environment building

NETCORE performance troubleshooting

Detailed explanation of Android interview notes handler

The title of my composition is - "my district head father"

Network remote access using raspberry pie
随机推荐
zabbix分布式系统监控
Daily Mathematics Series 52: February 20
金仓KFS数据集中场景(多对一)部署
《天天数学》连载52:二月二十日
Houdini graphic notes: could not create OpenCL device of type (houdini_ocl_devicetype) problem solving
WPF prism framework
[paper reading | depth] role based network embedding via structural features reconstruction with degree regulated
Kotlin implements a simple login page
每日3題(3)-檢查整數及其兩倍數是否存在
一个五年北漂的技术er,根据这些年的真实经历,给应届生的一些建议
keep-alive
Writing wechat applet with uni app
Nuxtjs actual combat case
Use of Siemens plcs7-200 (I) -- Introduction to development environment and configuration software
16 种企业架构策略
CSRF attack
Complete steps for a complete Oracle uninstall
金仓数据库 KingbaseES 插件identity_pwdexp
ES 学习
Application of global route guard