Re: truncate/create slowness - Mailing list pgsql-general

From Tom Lane
Subject Re: truncate/create slowness
Date
Msg-id 1551.1112312012@sss.pgh.pa.us
Whole thread Raw
In response to Re: truncate/create slowness  ("Julian Scarfe" <julian@avbrief.com>)
List pgsql-general
"Julian Scarfe" <julian@avbrief.com> writes:
> Do you have any rules of thumb for deciding when a pg_dumpall/restore is
> likely to be faster than a vacuum full?  Or perhaps more straightforwardly,
> how would you expect the time required for a vacuum full to scale with pages
> used and rows in the table?

There is a factor that's proportional to the number of tuples deleted,
and a bigger factor that's proportional to the number of tuples moved
while trying to compact the table.  If you've got a seriously bloated
table then it's fairly likely that *all* the surviving tuples will get
moved because none of them are near the start of the table already :-(

Having said that, though, a vacuum full and reindex on pg_class and
pg_attribute will certainly solve Steve's problem faster than a dump
and reload, simply because there's not much stuff in those catalogs
compared to any reasonably-sized user tables.

            regards, tom lane

pgsql-general by date:

Previous
From: "Cristian Prieto"
Date:
Subject: Help with case in select
Next
From: Jamie Deppeler
Date:
Subject: getGeneratedKeys()