Re: Measuring relation free space

From: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Measuring relation free space
Date: 2012-01-18 14:46:20
Message-ID: CAJKUy5j+djDL83dRUj02rUsUzhSZ9xRUWFGAo-zOEEYcBOc=4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 16, 2012 at 5:09 AM, Noah Misch <noah(at)leadboat(dot)com> wrote:
>
> pgstattuple()'s decision to treat half-dead pages like deleted pages is
> better.  That transient state can only end in the page's deletion.
>

the only page in that index has 200 records (all live 0 dead) using
half the page size (which is a leaf page and is not half dead, btw).
so, how do you justify that pgstattuple say we have just 25% of free
space?

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

> I don't know about counting non-leaf pages

ignoring all non-leaf pages still gives a considerable difference
between pgstattuple and relation_free_space()

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2012-01-18 14:50:07 Re: [v9.2] sepgsql's DROP Permission checks
Previous Message Tom Lane 2012-01-18 14:46:14 Re: Command Triggers