is there a way to check table data MB/GB SIZE?

reyservicenow
Tera Expert

is there a way to check table data MB/GB SIZE?

thanks

6 REPLIES 6

Shishir Srivast
Mega Sage

Please check if this helps: Finding Size of Instance Database


Shishir Srivast
Mega Sage

gs.sql("SELECT TABLE_NAME, TABLE_ROWS, ROUND(((data_length + index_length) / 1024 / 1024), 2) TABLE_SIZE_MB FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' ORDER BY 3 DESC");  



Example:



TABLE_NAME, TABLE_ROWS, TABLE_SIZE_MB


sys_upgrade_history_log, 340131, 1458.94


sys_attachment_doc, 20109, 220.16


sys_audit, 55394, 61.13


...



To use gs.sql(), you have to elevate privilege to security_admin and use "Scripts - Background" from the Navigator.


wait not instance size... just a table data size... for example table named sys_user how i find out how big that table size in MB/GB is?


Hi Rey,



I hoped the previous response should help, i was not able to run but got this info from community, which showed the result like:



TABLE_NAME, TABLE_ROWS, TABLE_SIZE_MB


sys_upgrade_history_log, 340131, 1458.94


sys_attachment_doc, 20109, 220.16


sys_audit, 55394, 61.13



Reference: Re: How to see the size of the database in ServiceNow