Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 160FC476E79; Thu, 12 Dec 2002 17:20:35 -0500 (EST) Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id EF728476F48; Thu, 12 Dec 2002 17:15:14 -0500 (EST) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id RAA10695; Thu, 12 Dec 2002 17:15:09 -0500 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma010693; Thu, 12 Dec 02 17:15:01 -0500 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id RAA05215; Thu, 12 Dec 2002 17:13:30 -0500 Message-ID: <3DF90A89.61040846@nsd.ca> Date: Thu, 12 Dec 2002 17:15:37 -0500 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-31 i686) X-Accept-Language: en MIME-Version: 1.0 To: Stephan Szabo Cc: pgsql-general@postgresql.org, pgsql-performance@postgresql.org Subject: Re: CLUSTER command References: <20021212135913.Q11714-100000@megazone23.bigpanda.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/671 X-Sequence-Number: 34586 The current cluster command is equivalant to: create b as select * from a order by i; So you would not be loosing anything. Stephan Szabo wrote: > > On Thu, 12 Dec 2002, Jean-Luc Lachance wrote: > > > Hi all, > > > > I just read about the cluster command and was a little (very) > > disapointed. > > Clustered tables do not remain clustered after inserts. > > Clustered tables are usefull when the table is very large and there are > > few different keys. > > > > > > Because the table file is already extended (2G limit) using different > > files extension (.N) > > how complicated (modifying the code) would it be to have the table files > > split according to the cluster key? > > I'd vote against changing the existing CLUSTER since the existing CLUSTER > while not great does handle many different key values fairly well as well > and this solution wouldn't. Many different key values are still > useful to cluster if you're doing searches over ranges since it lowers the > number of heap file reads necessary. If done this should probably be > separate from the existing cluster or at least both versions should be > possible.