当前位置:网站首页>GBase 8c 数据库对象尺寸函数(一)
GBase 8c 数据库对象尺寸函数(一)
2022-07-27 23:56:00 【大壮十二】
数据库对象尺寸函数计算数据库对象使用的实际磁盘空间。
pg_column_size(any)
描述:存储一个指定的数值需要的字节数(可能压缩过)。
返回值类型:int
备注:pg_column_size显示用于存储某个独立数据值的空间。
gbase=# SELECT pg_column_size(1);
pg_column_size
----------------
4
(1 row)
pg_database_size(oid)
描述:指定OID代表的数据库使用的磁盘空间。
返回值类型:bigint
pg_database_size(name)
描述:指定名称的数据库使用的磁盘空间。
返回值类型:bigint
备注:pg_database_size接受一个数据库的OID或者名称,然后返回该对象使用的全部磁盘空间。
示例:
gbase=# SELECT pg_database_size('postgres');
pg_database_size
------------------
30840684
(1 row)
pg_relation_size(oid)
描述:指定OID代表的表或者索引所使用的磁盘空间。
返回值类型:bigint
get_db_source_datasize()
描述:估算当前数据库非压缩态的数据总容量。
返回值类型:bigint
备注:(1)调用该函数前需要做analyze;(2)通过估算列存的压缩率计算非压缩态的数据总容量。
示例:
gbase=# analyze;
ANALYZE
gbase=# select get_db_source_datasize();
get_db_source_datasize
------------------------
31029100
(1 row)
pg_relation_size(text)
描述:指定名称的表或者索引使用的磁盘空间。表名称可以用模式名修饰。
返回值类型:bigint
pg_relation_size(relation regclass, fork text)
描述:指定表或索引的指定分叉树('main','fsm'或'vm')使用的磁盘空间。
返回值类型:bigint
pg_relation_size(relation regclass)
描述:pg_relation_size(…, 'main')的简写。
返回值类型:bigint
备注:pg_relation_size接受一个表、索引、压缩表的OID或者名称,然后返回它们的字节大小。
边栏推荐
- Interview question 01.05. Primary editing
- C # learning notes ----- C # connect to MySQL database
- Can ordinary equipment access TSN time sensitive network?
- Opengauss active / standby architecture works with keeplive
- Leetcode 2341. How many pairs can an array form
- "Do you" want to be a test / development programmer? We strive to sprout
- JUC concurrent programming learning
- 了解Shader
- IIC read / write eefprom
- 面试题 01.05. 一次编辑
猜你喜欢
随机推荐
Interview question 01.05. Primary editing
【taichi】在太极中画出规整的网格
现货白银如何计算盈亏
Dart code comments and documentation specification
BGP联邦实验
Login function implementation
集合/容器
Storage practices for high-performance computing scenarios, see here
写给去不图床用户的一封信
LeetCode 2341. 数组能形成多少数对
Software test interview question: how to prepare test data? How to prevent data pollution?
Docker builds MySQL master-slave locally
实现OCR语言识别Demo(二)- 图片及识别内容的展现和交互
[style set 1] tab
暴雪《暗黑破坏神 4》PS5 / PS4 测试版添加到 PlayStation 数据库
"Do you" want to be a test / development programmer? We strive to sprout
js 哪些情况不能用 JSON.parse 、JSON.stringify深拷贝及一个更好的深拷贝方法
Day 013 one dimensional array exercise
Sort out SQL performance optimization and collect classics!
Count the number of given strings in a string









