This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a few scripts for checking the size of Database, Schema and Table of Greenplum Server.
Here, I am doing this exercise using the views of the gp_toolkit schema of Greenplum.
Check the size of database in MB, GB and TB:
1 2 3 4 5 6 7 8 |
SELECT sodddatname, (sodddatsize/1048576) AS Sizein_MB FROM gp_toolkit.gp_size_of_database; SELECT sodddatname, (sodddatsize/1073741824) AS Sizein_GB FROM gp_toolkit.gp_size_of_database; SELECT sodddatname, (sodddatsize/1073741824)/1024 AS Sizein_TB FROM gp_toolkit.gp_size_of_database; |
Checkt the size of database in MB, GB and TB:
1 2 3 4 5 6 7 8 |
SELECT sosdnsp, (sosdschematablesize/1048576) AS Sizein_MB FROM gp_toolkit.gp_size_of_schema_disk; SELECT sosdnsp, (sosdschematablesize/1073741824) AS Sizein_GB FROM gp_toolkit.gp_size_of_schema_disk; SELECT sosdnsp, (sosdschematablesize/1073741824)/1024 AS Sizein_TB FROM gp_toolkit.gp_size_of_schema_disk; |
Check the size of any Table or Index:
1 |
SELECT pg_size_pretty(pg_total_relation_size('schema_name.table_name')); |
Leave a Reply