Re: Buglist - Mailing list pgsql-general

From Tom Lane
Subject Re: Buglist
Date
Msg-id 17323.1061409726@sss.pgh.pa.us
Whole thread Raw
In response to Re: Buglist  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Re: Buglist  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-general
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> True, but the message being responded to was specifically "if the backend
> were to do the checking for external references upon updating/deleting a
> row".

It's clearly impossible for a backend to remove a row immediately upon
updating/deleting it, since it cannot know whether it will succeed in
committing its transaction.  The implementable variant of this would
correspond to extending the check-whether-committed-deleted code to see
whether a previously deleted tuple is now removable --- that is, moving
VACUUM's processing of the tuple into the main line.

> In any case, I thought it only does the committed deleted stuff
> when it comes upon a row in a scan, which means that it's still not
> automatic clean up in general since any particular deleted row may not get
> looked at for some amount of time after all possible viewers are gone.

Recall also that "committed deleted" does not mean "safe to remove".
There may still be live transactions that could see the tuple.  The
"committed deleted" bit just exists to allow subsequent visitors to the
row to skip one of the more expensive steps in deciding whether they can
see it or not.

To determine that a row is removable requires additional tests above and
beyond what backends normally do.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Grouping by date range
Next
From: Jan Wieck
Date:
Subject: Re: Buglist