当前位置:网站首页>[维护集群案例集] 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;
边栏推荐
- 2022-06-24:golang选择题,以下golang代码输出什么?A:1;B:3;C:4;D:编译失败。 package main import ( “fmt“ ) func mai
- Task03 probability theory
- 金仓数据库 KingbaseES 插件identity_pwdexp
- A random number generator
- Android: generic mapping analysis of gson and JSON in kotlin
- On binary tree
- Shen Ying, China Academy of communications and communications: font open source protocol -- Introduction to ofl v1.1 and analysis of key points of compliance
- Oracle彻底卸载的完整步骤
- [file inclusion vulnerability-04] classic interview question: how to getshell when a website is known to have only local file inclusion vulnerability?
- 中國信通院沈瀅:字體開源協議——OFL V1.1介紹及合規要點分析
猜你喜欢
Open source invites you to participate in the openssf Open Source Security Online Seminar
COSCon'22 讲师征集令
中國信通院沈瀅:字體開源協議——OFL V1.1介紹及合規要點分析
[image fusion] image fusion based on morphological analysis and sparse representation with matlab code
戴尔科技演绎“快”字诀,玩转CI/CD
Advanced single chip microcomputer -- development of PCB (2)
TASK03|概率论
垃圾回收机制
At 16:00 today, Mr. sunxiaoming, a researcher of the Institute of computing, Chinese Academy of Sciences, took you into the quantum world
Technical practice and development trend of video conference all in one machine
随机推荐
NETCORE performance troubleshooting
手机办理广州证券开户靠谱安全吗?
数组结构整理
Macro application connector\
Houdini graphic notes: could not create OpenCL device of type (houdini_ocl_devicetype) problem solving
Think about it
Technical practice and development trend of video conference all in one machine
金仓数据库 KingbaseES 插件force_view
服务端渲染
Kotlin arrays and collections (1) {create arrays, use arrays, use for in loops to traverse arrays, use array indexes, and multi-dimensional arrays}
Continuous delivery jenkinsfile syntax
看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-7
性能之文件系统篇
Software testing to avoid being dismissed during the probation period
网络远程访问的方式使用树莓派
金仓数据库 KingbaseES 插件DBMS_UTILITY
学会自学【学会学习本身,比学什么都重要】
VW VH adaptation of mobile terminal
COSCon'22 讲师征集令
Dell technology performs the "fast" formula and plays ci/cd