This article is intended to outline a process for measuring total size of a Greenplum Database
Greenplum Database provides an administrative schema called gp_toolkit that you can use to query the system catalogs, log files, and operating environment for system status information. gp_size_of_table_and_indexes_licensing is a view within gp_toolkit that shows the total size of tables of a given database that can be used for licensing purposes. The use of this view requires database, superuser permissions. The view is available on all versions of Greenplum.
Reference Greenplum documentation for more information.
Example Usage:
SELECT * from gp_toolkit.gp_size_of_table_and_indexes_licensing;
Column |
Description |
sotailoid |
The object ID of the table |
sotailtablesizedisk |
The total disk size of the table in bytes |
sotailtablesizeuncompressed |
The total uncompressed disk size of the table in bytes |
sotailindexessize |
The total size of all indexes in the table in bytes |
sotailschemaname |
The schema name |
sotailtablename |
The table name |
The summation of sotailtablesizeuncompressed and sotailindexessize for all tables is the total size of data for an individual database.
Example usage to determine total size of a database in Gigabytes:
SELECT (SUM(sotailtablesizeuncompressed + sotailindexessize)/1024/1024/1024)::decimal(10,2) AS "Total Database Size (GB)" from gp_toolkit.gp_size_of_table_and_indexes_licensing;
The summation of this information for all databases in a Greenplum cluster can be used for licensing purposes. It must be run separately on all databases of a cluster.