Re: Buglist - Mailing list pgsql-general

From Tom Lane
Subject Re: Buglist
Date
Msg-id 16292.1061408366@sss.pgh.pa.us
Whole thread Raw
In response to Re: Buglist  (Vivek Khera <khera@kcilink.com>)
Responses Decent VACUUM (was: Buglist)  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-general
Vivek Khera <khera@kcilink.com> writes:
> "JW" == Jan Wieck <JanWieck@Yahoo.com> writes:
> JW> remove all the index entries pointing to these ctid's. Your idea is (so
> JW> far) lacking a place where to remember all the single removed rows and I
> JW> assume you're not planning to pay the cost of a full scan over all
> JW> indexes of a table to reclaim the space of one data row, are you?

> Well, that pretty much kills my idea...  back to autovacuum ;-)

In addition to the index-cleanup issue that Jan explained, there are
locking problems.  The tuple-is-dead hint bit mechanism is very
carefully designed so that a backend can set the hint bits while holding
only a shared lock on the page containing the tuple.  Physically
removing a tuple requires a far stronger lock (see the source code for
details).  Thus, having ordinary interactive backends remove tuples
would have bad consequences for concurrent performance.

But I think the real point here is that there's no reason to think that
doing tuple deletion on-the-fly in foreground transactions is superior
to doing it in background with a vacuum process.  You're taking what
should be noncritical maintenance work and moving it into the critical
paths of your foreground applications.  Not only that, but you're
probably doing more total work per tuple --- VACUUM "batches" its work
in more ways than just the index cleanup aspect, IIRC.

            regards, tom lane

pgsql-general by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: Mailing list in French
Next
From: Greg Stark
Date:
Subject: Collation rules and multi-lingual databases