On Wed, Feb 19, 2003 at 10:37:45PM -0500, Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > You could do the jump-back-in-blocks only if more than 30% of the table is
> > empty and table is over 1GB. For the example here, a simple defragging
> > algorithm would suffice; start at beginning and pack each tuple into the
> > beginning of the file. It will move *every* tuple but it's more cache
> > friendly. It's pretty extreme though.
>
> And your evidence that it will actually be faster is ... ?
Will, in this guy's example, the first stage of the vacuum (scan_heap)
finished in a few hours but the second stage is still going after 50 hours
and estimating a bit over half done. The major difference between the two is
that the latter goes backwards through the table and the other forwards.
Sure, it's anecdotal and a bit hand wavey but I think there's something to
it. Come to think of it, if that strace had used -tt it would have been
more interesting.
Anyway, the test would be to implement it and them time it. The vacuum code
looks scary though. I'm not sure if I want to mess with it...
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.