当前位置:网站首页>[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;

边栏推荐
- 金仓数据库 KingbaseES 插件force_view
- [image fusion] image fusion based on morphological analysis and sparse representation with matlab code
- 好好思考
- Houdini graphic notes: could not create OpenCL device of type (houdini_ocl_devicetype) problem solving
- XSS攻击
- 网络远程访问的方式使用树莓派
- 炒股票开户的话,手机开户安全吗?有谁知道啊?
- Oracle彻底卸载的完整步骤
- OODA working method
- A five-year technical Er, based on the real experience of these years, gives some suggestions to the fresh students
猜你喜欢

Network remote access using raspberry pie

无心剑中译伊玛·拉扎罗斯《新巨人·自由女神》

Es learning

Houdini graphic notes: could not create OpenCL device of type (houdini_ocl_devicetype) problem solving

COSCon'22 讲师征集令

Kotlin arrays and collections (1) {create arrays, use arrays, use for in loops to traverse arrays, use array indexes, and multi-dimensional arrays}

FPGA基于VGA显示字符及图片

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

Compilation of learning from Wang Shuang (1)

Use of three-level linkage plug-ins selected by provinces and cities
随机推荐
WPF prism framework
Application of global route guard
A random number generator
Performance network
【观察】ObjectScale:重新定义下一代对象存储,戴尔科技的重构与创新
[维护集群案例集] GaussDB 查询用户空间使用情况
Is it safe to open a stock account on the compass?
无心剑中译伊玛·拉扎罗斯《新巨人·自由女神》
【系统分析师之路】第六章 复盘需求工程(综合知识概念)
MySQL synchronous data configuration and shell script implementation
QT: parsing JSON
垃圾回收机制
Use of three-level linkage plug-ins selected by provinces and cities
Handler asynchronous message processing
从GEE中免费获取全球人类住区层 (GHSL) 数据集
Android:kotlin中Gson与JSON的泛型映射解析
【文件包含漏洞-03】文件包含漏洞的六种利用方式
视频会议一体机的技术实践和发展趋势
网络远程访问的方式使用树莓派
Is it safe to open an account through mobile phone if you open an account through stock speculation? Who knows?