Skip site navigation (1) Skip section navigation (2)

Re: Measuring relation free space

From: Noah Misch <noah(at)leadboat(dot)com>
To: Bernd Helmle <mailings(at)oopsware(dot)de>, jaime(at)2ndquadrant(dot)com
Cc: Greg Smith <greg(at)2ndQuadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Measuring relation free space
Date: 2011-12-15 21:11:21
Message-ID: 20111215211121.GC32454@tornado.leadboat.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sun, Nov 06, 2011 at 10:20:49PM +0100, Bernd Helmle wrote:
> --On 6. November 2011 01:08:11 -0200 Greg Smith <greg(at)2ndQuadrant(dot)com> wrote:
>
>> Attached patch adds a new function to the pageinspect extension for measuring
>> total free space, in either tables or indexes.
>
> I wonder if that should be done in the pgstattuple module, which output 
> some similar numbers.

Indeed, pgstattuple already claims to show precisely the same measure.  Its
reckoning is right in line for heaps, but the proposed pageinspect function
finds more free space in indexes:

[local] test=# SELECT t.free_percent, relation_free_space('pg_proc'), i.free_percent, relation_free_space('pg_proc_proname_args_nsp_index') FROM pgstattuple('pg_proc') t, pgstattuple('pg_proc_proname_args_nsp_index') i;
 free_percent | relation_free_space | free_percent | relation_free_space 
--------------+---------------------+--------------+---------------------
         2.53 |           0.0253346 |         8.61 |            0.128041
(1 row)

Is one of those index figures simply wrong, or do they measure two senses of
free space, both of which are interesting to DBAs?

Thanks,
nm

In response to

Responses

pgsql-hackers by date

Next:From: amit sehasDate: 2011-12-15 21:15:57
Subject: Cursor behavior
Previous:From: Dimitri FontaineDate: 2011-12-15 20:31:26
Subject: Re: Command Triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group