Re: Truncating/vacuuming relations on full tablespaces - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Truncating/vacuuming relations on full tablespaces
Date
Msg-id 27236.1452885398@sss.pgh.pa.us
Whole thread Raw
In response to Re: Truncating/vacuuming relations on full tablespaces  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Truncating/vacuuming relations on full tablespaces
Re: Truncating/vacuuming relations on full tablespaces
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Now, I do think it's a somewhat fair complaint that if you have a
> tablespace which is totally, 100% full, recovery is difficult.  You
> can probably DROP the table, but TRUNCATE might fail, and so might
> VACUUM.  You could argue that DROP is usually a good substitute for
> TRUNCATE, although there could be dependencies, but DROP is certainly
> not a good substitute for VACUUM.  We could address the VACUUM case by
> having an optional argument to VACUUM which tells it to skip VM and
> FSM maintenance, presumably to be used only in case of emergency.  I'm
> not sure if it's worth having for what is presumably  a pretty rare
> case, but it seems like it could be done.

Presumably the hope would be that VACUUM would truncate off some of the
heap, else there's not much good that's going to happen.  That leaves
me wondering exactly what the invariant is for the maps, and if it's
okay to not touch them during a heap truncation.

I believe that there would be ramifications for some of the index AMs
too.  For example, if left to its own devices GIN would consider VACUUM
to include flushing its pending-list pages, which more than likely will
increase not reduce the total index size.  I'm not sure that it has
any ability to omit that step; can it remove dead entries directly off
the pending pages, or only from the main index?

On the whole this sounds like a lot of work, and a lot of hard-to-test
seldom-exercised code, for a very very narrow corner case.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Truncating/vacuuming relations on full tablespaces
Next
From: Devrim Gündüz
Date:
Subject: Re: Death by regexp_replace