result_free_space.out

application/octet-stream

Filename: result_free_space.out
Type: application/octet-stream
Part: 1
Message: Re: Measuring relation free space
        relname        | reltuples |    reloptions    
-----------------------+-----------+------------------
 audit_log             |    804977 | 
 pgbench_accounts      |   1529890 | {fillfactor=90}
 pgbench_accounts_pkey |   1529890 | {fillfactor=50}
 pgbench_branches      |        20 | {fillfactor=100}
 pgbench_branches_pkey |        20 | 
 pgbench_history       |     94062 | 
 pgbench_tellers       |       200 | {fillfactor=100}
 pgbench_tellers_pkey  |       200 | 
(8 rows)

postgres=# \i free_space.sql 
        relname        | total_size | fsm_free_size | relation_free_space | pgstattuple_free_pct 
-----------------------+------------+---------------+---------------------+----------------------
 audit_log             |  156770304 |      0.002457 |           0.0046123 |               0.0046
 pgbench_accounts      |  297893888 |      0.311301 |            0.312234 |               0.3122
 pgbench_accounts_pkey |   44949504 |      0.099301 |            0.309935 |               0.3085
 pgbench_branches      |     212992 |      0.879657 |            0.882249 |               0.8822
 pgbench_branches_pkey |      16384 |      0.000000 |            0.945801 |               0.4729
 pgbench_history       |    5005312 |      0.013688 |           0.0137238 |               0.0137
 pgbench_tellers       |     253952 |      0.861391 |            0.862572 |               0.8626
 pgbench_tellers_pkey  |      57344 |      0.000000 |            0.909749 |               0.6393
(8 rows)

VACUUM FULL;
REINDEX;

postgres=# \i free_space.sql 
        relname        | total_size | fsm_free_size | relation_free_space | pgstattuple_free_pct 
-----------------------+------------+---------------+---------------------+----------------------
 audit_log             |  156737536 |      0.002252 |          0.00440494 |               0.0044
 pgbench_accounts      |  227876864 |      0.109402 |            0.110378 |               0.1104
 pgbench_accounts_pkey |   62283776 |      0.000000 |            0.498422 |               0.4971
 pgbench_branches      |       8192 |      0.906250 |            0.908691 |               0.9087
 pgbench_branches_pkey |      16384 |      0.000000 |            0.945801 |               0.4729
 pgbench_history       |    4939776 |      0.000680 |         0.000684242 |               0.0007
 pgbench_tellers       |      16384 |      0.457031 |            0.459473 |               0.4595
 pgbench_tellers_pkey  |      16384 |      0.000000 |            0.506348 |               0.2532
(8 rows)


postgres=# SELECT * FROM bt_page_stats('pgbench_tellers_pkey', 1);
 blkno | type | live_items | dead_items | avg_item_size | page_size | free_size | btpo_prev | btpo_next | btpo | btpo_flags 
-------+------+------------+------------+---------------+-----------+-----------+-----------+-----------+------+------------
     1 | l    |        200 |          0 |            16 |      8192 |      4148 |         0 |         0 |    0 |          3
(1 row)