Re: surprised to find bloat in insert-only table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Stosberg <mark(at)summersault(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: surprised to find bloat in insert-only table
Date: 2011-06-03 17:39:12
Message-ID: 1739.1307122752@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mark Stosberg <mark(at)summersault(dot)com> writes:
> Compared to 1669 MB reported as table bloat in the 'bloat' view. So,
> the bloat is about 40% of the total size.
> For an index, it's 410 MB of bloat, vs 1669 MB for an index size.

Hm ... 40% unused space wouldn't be surprising at all for an index.
The traditional rule of thumb for a b-tree index is that the steady
state fill factor is about 2/3rds. You can do better for an index that
is loaded in increasing order (eg, an index on a serial or timestamp
column typically has a higher fill factor) but indexes on columns that
are more random are not going to see that.

> One thing that looks suspicious is that the exact same number of bytes
> is being report for the table as well as each index.

Um. In that case I'd say your view is flat out wrong...

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Holt 2011-06-03 18:07:15 Streaming replication status and fail over questions
Previous Message Mark Stosberg 2011-06-03 17:03:31 Re: surprised to find bloat in insert-only table