I'm working on a project where calculations are being made for certain tables in the postgres DB, and in different parts of code, there are 2 different calculations being made:
select pg_total_relation_size ('TABLENAME'); and the second one:
select (relpages*8/1024) from pg_class where relname='TABLENAME' (Size in MB) I know that pg_total_relation_size is what I need to use, but I was wondering what does this other calculation represents, and if the second one is also some kind of size calculation, why am I getting different results for the same table?