Re: When does CLUSTER occur?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: sthomas(at)optionshouse(dot)com
Cc: Mike Christensen <mike(at)kitchenpc(dot)com>, "Schnabel, Robert D(dot)" <schnabelr(at)missouri(dot)edu>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: When does CLUSTER occur?
Date: 2012-11-29 18:20:11
Message-ID: CAMkU=1zB9m66uc7khjppKQeTbcsHhR_CGOOMFVvhsxMP0qNfHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 29, 2012 at 9:33 AM, Shaun Thomas <sthomas(at)optionshouse(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shaun Thomas 2012-11-29 18:28:55 Re: When does CLUSTER occur?
Previous Message Mike Christensen 2012-11-29 17:43:27 Re: When does CLUSTER occur?