Vivek Khera <[EMAIL PROTECTED]> writes: > "JW" == Jan Wieck <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend