From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Vivek Khera <khera(at)kcilink(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Buglist |
Date: | 2003-08-20 19:39:26 |
Message-ID: | 16292.1061408366@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
Vivek Khera <khera(at)kcilink(dot)com> writes:
> "JW" == Jan Wieck <JanWieck(at)Yahoo(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Stark | 2003-08-20 19:40:32 | Collation rules and multi-lingual databases |
Previous Message | The Hermit Hacker | 2003-08-20 19:27:07 | Re: Mailing list in French |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-08-20 20:02:06 | Re: Buglist |
Previous Message | Manfred Koizar | 2003-08-20 19:21:14 | Again on index correlation |