Re: CLUSTER and clustered indices

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: CLUSTER and clustered indices
Date: 2005-11-17 15:45:48
Message-ID: 20051117154548.GA7658@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2005-11-17 15:57:33 Re: Numeric 508 datatype
Previous Message Michael Paesold 2005-11-17 15:28:01 Re: Optional postgres database not so optional in 8.1