Re: Vacuum problems

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>, Scot Kreienkamp <SKreien(at)la-z-boy(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Vacuum problems
Date: 2009-01-06 23:16:00
Message-ID: 4963E630.8050705@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Scott Marlowe wrote:

> While I don't wholly disagree with periodic reindexing, I do recommend
> that one keeps track of bloat. It's easy enough to have an alarm that
> goes off if any index gets over 50% dead space, then go look at the
> database.

Reading this list, I've noticed that:

- Many admins don't understand vacuum vs vacuum full at all,
and are unaware of the probable need for a reindex after
vacuum full. They're often landing up with very bloated indexes
from excessive use of vacuum full, or very bloated tables due
to insufficient fsm space / infrequent vacuuming.

- It's hard to spot table and (especially) index bloat. Pg doesn't
warn about bloated tables or indexes in any way that people seem to
notice, nor are there any built-in views or functions that might help
the admin identify problem tables and indexes.

- Most people have a lot of trouble understanding where and how
their storage is being used.

I'm wondering if it might be a good idea to adopt one of the handy views
people have written for getting table/index bloat information as a
standard part of Pg (probably as an SQL function rather than a view) so
people can just "SELECT pg_bloat()" to get a useful summary of
table/index status.

The other thing I wonder about is having EXPLAIN and EXPLAIN ANALYZE
report information on the amount of free space that a table seq scan or
an index scan is having to traverse. That might bring problems to the
attention of people who're investigating query performance issues
without being aware that the underlying issue is actually bloated
indexes, not bad plans.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2009-01-06 23:19:16 Re: COPY ... FROM Permission denied ...
Previous Message Martijn van Oosterhout 2009-01-06 22:13:41 Re: [HACKERS] ERROR: failed to find conversion function from "unknown" to text