Re: Suggestion; "WITH VACUUM" option - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Suggestion; "WITH VACUUM" option
Date
Msg-id 29163.1040077994@sss.pgh.pa.us
Whole thread Raw
In response to Suggestion; "WITH VACUUM" option  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Suggestion; "WITH VACUUM" option
List pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:
> How hard would it be to add a "WITH (VACUUM)" option to UPDATE and DELETE 
> queries?   This option would cause the regular vacuum activity -- purging the
> dead tuple and its index references -- to be done immediately, as part of the
> statement, instead of being deferred.

> Easy?  Hard?  Insane?  What do you think?

Impossible.  You can't vacuum a tuple until the last open transaction
that can see it is gone.  It is therefore *impossible* for a transaction
to vacuum away its own detritus; until the transaction commits, you
can't even start to wonder whether other open transactions see it or
not.

Vacuuming has to be done later, and that being the case, I don't see any
real advantage to altering the "background vacuum" design we have.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Iavor Raytchev
Date:
Subject: pgaccess 0.98.8 - released
Next
From: "scott.marlowe"
Date:
Subject: Re: Suggestion; "WITH VACUUM" option