Thread: vacuum full question.
What happens when a vacuum full is canceled? Is any of the completed work retained, or is everything lost?
The general principle is that any transaction that is being canceled is fully lost and the database remains in the same state as before the transaction was started. I don't know the pgsql internals but I don't see why this shouldn't be the case for a VACUUM too. Marc At 1:23 PM -0400 4/21/04, Michael Guerin wrote: >What happens when a vacuum full is canceled? Is any of the >completed work retained, or is everything lost? > > > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Sure, however this is not a data consistency issue, it's a maintenance routine. If its shuffling around data to free up pages, it seems it should be able to save some of this work. For instance, SQL server has a command to defrag an index: dbcc indexdefrag which I believe is similar to vacuum, in that it reorganizes the data check out:. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_dbcc_30o9.asp M. Bastin wrote: > The general principle is that any transaction that is being canceled > is fully lost and the database remains in the same state as before the > transaction was started. > > I don't know the pgsql internals but I don't see why this shouldn't be > the case for a VACUUM too. > > Marc > > At 1:23 PM -0400 4/21/04, Michael Guerin wrote: > >> What happens when a vacuum full is canceled? Is any of the completed >> work retained, or is everything lost? >> >> >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 2: you can get off all lists at once with the unregister command >> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >
Michael Guerin <guerin@rentec.com> writes: > What happens when a vacuum full is canceled? Is any of the completed > work retained, or is everything lost? You lose it all; in fact you are worse off than when you started, because there is now *more* work for the next vacuum to do --- it has to clean up the dead tuples that the canceled vacuum created (in the process of moving data around) and never got to commit. However, this is on a per-table basis --- if you are running a database-wide vacuum full, it commits after each table, so the already-processed tables are done. regards, tom lane