Re: CLUSTER and clustered indices - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: CLUSTER and clustered indices
Date
Msg-id 20051117154548.GA7658@surnet.cl
Whole thread Raw
In response to CLUSTER and clustered indices  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> When a table has been CLUSTERed on a particular index AND that index
> values is monotonically increasing, then it would be a bad move to use
> blocks from the FSM since this would tend to destroy the natural
> clustering sequence.
> 
> The index values will be monotonically increasing if a datatype is
> defined as SERIAL or if the default value is defined as the nextval of a
> sequence.
> 
> Does anybody think it would be a good idea to not use the FSM if
> - we have a CLUSTER defined on an index
> - for the indexed column we have default value set of nextval()

That's a nice idea, but what's the cost?  You will have to check every
insert: does the table has indexes?  Is any of them clustered?  Is the
clustered index attached to a sequence?  It seems quite an expensive
check to be making.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CLUSTER and clustered indices
Next
From: Merlin Moncure
Date:
Subject: Re: 8.0 -> 8.1 dump duplicate key problem?