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

From Mike Christensen
Subject Re: When does CLUSTER occur?
Date
Msg-id CABs1bs38fjBaqyDo=1vGTys9MY22h+211Cn89n0TMKeCNuJ3Vw@mail.gmail.com
Whole thread Raw
In response to 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 guess that's one thing rollback segments are good for. In-place modifications of data so order can be maintained.

 
Yea, in MS SQL, inserts are more expensive with a clustered index because it has to go move junk around on the heap table..

I've just kinda gotten used to the PG approach, as you can always just re-cluster if you do some huge insert of a bunch of data. I guess what I'd be asking for is a feature that would automatically re-cluster whenever new data was committed, however you could just do that with a trigger I suppose..

pgsql-general by date:

Previous
From: "Schnabel, Robert D."
Date:
Subject: Re: When does CLUSTER occur?
Next
From: Jeff Janes
Date:
Subject: Re: When does CLUSTER occur?