Re: When does CLUSTER occur? - Mailing list pgsql-general

From Jeff Janes
Subject Re: When does CLUSTER occur?
Date
Msg-id CAMkU=1zB9m66uc7khjppKQeTbcsHhR_CGOOMFVvhsxMP0qNfHw@mail.gmail.com
Whole thread Raw
In response to Re: When does CLUSTER occur?  (Shaun Thomas <sthomas@optionshouse.com>)
Responses Re: When does CLUSTER occur?  (Shaun Thomas <sthomas@optionshouse.com>)
List pgsql-general
On Thu, Nov 29, 2012 at 9:33 AM, Shaun Thomas <sthomas@optionshouse.com> wrote:
> On 11/29/2012 11:28 AM, Mike Christensen wrote:
>
>> It's always kinda annoyed me that the CLUSTER command in Postgres
>> doesn't work like it does on Microsoft SQL.
>
>
> It's a natural side-effect of MVCC, unfortunately. Data goes wherever it
> goes according to the free space map, or at the end if there are no free
> blocks in the table.

I think the two things are pretty much orthogonal.  MVCC might
complicate the coding for maintaining clustering (either a little or
lot, depending the approach) but surely doesn't forbid it.

It should be relatively easy, when inserting a new tuple, to first try
blocks which have "nearby" tuples to see if they have room, before
falling back on normal fsm or extension.  It would maintain an
imperfect clustering, but still much better than current behavior.

Cheers,

Jeff


pgsql-general by date:

Previous
From: Mike Christensen
Date:
Subject: Re: When does CLUSTER occur?
Next
From: Shaun Thomas
Date:
Subject: Re: When does CLUSTER occur?