On Thu, May 01, 2008 at 05:12:52PM -0700, fschmidt wrote:
>
> An implementation of clustering without locking would start by comparing the
> index to the table from the beginning to find the first mismatch. Rows
> before the mismatch are fine, and can be left alone. From here on, go
> through the index and rewrite each row in order. This will put the rows at
> the end of the table in cluster order. When done, vacuum the table. This
> will result in a clustered table without any locking needed. Those few
> records that were updated while clustering was happening will be out of
> order, but that should only be a few.
Huh? If I'm understanding you correctly you'll end up with rows in
order, but with a really big hole in the middle of the table. I'm not
sure if that qualifies as "clusters".
> So, could this work? I could really use clustering without locking.
Nice idea, but I don't think it's going to work.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.