Re: clustering without locking

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: fschmidt <fschmidt(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: clustering without locking
Date: 2008-05-02 06:18:39
Message-ID: 20080502061839.GA26975@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fujii Masao 2008-05-02 07:11:24 Re: clustering without locking
Previous Message Tom Lane 2008-05-02 05:27:08 Re: How to modify ENUM datatypes?