dh YB
dh YB

Reputation: 1097

Checking disk size consumed by each database in YugabyteDB

[Question posted by a user on YugabyteDB Community Slack]

Is there any way we can check the disk size consumed by each database, tables? I tried the query below but no luck:

- \l+
- select pg_database_size('databaseName');
- select t1.datname AS db_name,  
       pg_size_pretty(pg_database_size(t1.datname)) as db_size
from pg_database t1
order by pg_database_size(t1.datname) desc;

Upvotes: 1

Views: 386

Answers (1)

dh YB
dh YB

Reputation: 1097

YugabyteDB uses its native data storage called DocDB (i.e. Rocks DB) to store the table's data. These catalog tables will not have any sizing details. You can access individual table level details directly in the YugabyteDB Tablet Server UI http://<ipaddress>:9000/tables. It will show the on-disk space column for each table.

Table size can be measured in YSQL as of 2.15.3 :

SELECT pg_table_size('table_name');

Upvotes: 1

Related Questions