Check out example codes for "check size of table sql". It will help you in understanding the concepts better.

Code Example 1

SELECT pg_size_pretty( pg_total_relation_size('tablename') );
(postgres)

Learn ReactJs, React Native from akashmittal.com