postgres.rst
changeset 2343 984ccb104a6e
parent 2339 cb96d35c46cf
child 2373 07d81edeaba6
equal deleted inserted replaced
2342:fb128fcaf50a 2343:984ccb104a6e
   287   SELECT p.relname, t.relname, pg_size_pretty(pg_relation_size(p.oid)), p.relpages
   287   SELECT p.relname, t.relname, pg_size_pretty(pg_relation_size(p.oid)), p.relpages
   288   FROM pg_class p
   288   FROM pg_class p
   289   LEFT JOIN pg_class t ON t.reltoastrelid = p.oid
   289   LEFT JOIN pg_class t ON t.reltoastrelid = p.oid
   290   ORDER BY p.relpages DESC;
   290   ORDER BY p.relpages DESC;
   291 
   291 
       
   292 Size of types::
       
   293 
       
   294   SELECT pg_column_size(5::smallint);
       
   295   SELECT pg_column_size(5::int);
       
   296   SELECT pg_column_size(5::bigint);
       
   297 
       
   298 https://wiki.postgresql.org/wiki/Disk_Usage
       
   299    Finding the size of various object in your database.
       
   300 
   292 MVCC and transaction id
   301 MVCC and transaction id
   293 =======================
   302 =======================
   294 
   303 
   295 As being MVCC Postgres doesn't delete or update existing rows. Row visibility is controled by
   304 As being MVCC Postgres doesn't delete or update existing rows. Row visibility is controled by
   296 transaction id (monotonous incremented number): ``xmin`` - first transaction that can see row,
   305 transaction id (monotonous incremented number): ``xmin`` - first transaction that can see row,