a
PG sources relevant to lossy optimizations and index-node scanning:
https://github.com/postgres/postgres/blob/27b77ecf9f4d5be211900eda54d8155ada50d696/src/backend/optimizer/path/costsize.c#L1017-L1019 https://github.com/postgres/postgres/blob/27b77ecf9f4d5be211900eda54d8155ada50d696/src/backend/executor/nodeIndexscan.c#L137-L150 https://github.com/postgres/postgres/blob/27b77ecf9f4d5be211900eda54d8155ada50d696/src/backend/executor/nodeBitmapHeapscan.c#L241-L244
SELECT relname as tablename, pgsizepretty(pgtotalrelationsize(relid)) As “Total Size”, pgsizepretty(pgindexessize(relid)) as “Index Size”, pgsizepretty(pgrelationsize(relid)) as “Actual Size”, pgsizepretty(pgrelationsize(relid, ‘main’)), pgsizepretty(pgrelationsize(relid, ‘vm’)), pgsizepretty(pgrelationsize(relid, ‘fsm’)), pgsizepretty(pgrelationsize(relid, ‘init’)) FROM pgcatalog.pgstatiousertables ORDER BY pgtotalrelation_size(relid) DESC limit 3;