Re: AW: Plans for solving the VACUUM problem - Mailing list pgsql-hackers

From Tom Lane
Subject Re: AW: Plans for solving the VACUUM problem
Date
Msg-id 15097.990193675@sss.pgh.pa.us
Whole thread Raw
In response to AW: Plans for solving the VACUUM problem  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
List pgsql-hackers
Zeugswetter Andreas SB  <ZeugswetterA@wien.spardat.at> writes:
> foreach tuple in heap that can be deleted do:
>     foreach index
>         call the current "index delete" with constructed key and xtid

See discussion with Hiroshi.  This is much more complex than TID-based
delete and would be faster only for small numbers of tuples.  (Very
small numbers of tuples, is my gut feeling, though there's no way to
prove that without implementations of both in hand.)

A particular point worth making is that in the common case where you've
updated the same row N times (without changing its index key), the above
approach has O(N^2) runtime.  The indexscan will find all N index tuples
matching the key ... only one of which is the one you are looking for on
this iteration of the outer loop.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Klaus Reger
Date:
Subject: Re: Grammar-problems with pl/pgsql in gram.y
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: AW: Plans for solving the VACUUM problem