Re: Maintaining cluster order on insert

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Jaime Casanova <systemguards(at)gmail(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Maintaining cluster order on insert
Date: 2007-05-27 19:01:36
Message-ID: 20070527190136.GR92628@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Mon, May 21, 2007 at 10:48:59AM +0100, Heikki Linnakangas wrote:
> >Another problem that I noticed with the patch is that it disregards
> >the fillfactor while inserting the tuples. ISTM that this is a correct
> >behavior when a tuple is being inserted in the block to preserve cluster
> >ordering. But when the tuple is being inserted as a normal operation,
> >IMO we should respect the fillfactor.
> >
> >The easiest way to reproduce this is to insert tuples sorted on the
> >cluster index key.
>
> Actually it does respect the fillfactor when the block suggested by
> indexam is full. When you insert tuples sorted on the cluster index key,
> the suggested page after the first tuple on the new page is always the
> last page. Try inserting in random order instead.
>
> IOW it's working as designed. But maybe it's not the desired behavior.
> Should we have a special case and always respect the fillfactor when
> inserting to the last page of the heap?

I think that would be following with least surprise.
--
Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2007-05-28 13:30:44 Re: Why not keeping positions in GIN?
Previous Message Robert Treat 2007-05-27 18:19:48 Re: Reviewing temp_tablespaces GUC patch

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2007-05-28 04:44:31 Interval input: usec, msec
Previous Message Andrew Dunstan 2007-05-27 13:51:14 Re: cluster test