Skip site navigation (1) Skip section navigation (2)

Re: TPC-H Scaling Factors X PostgreSQL ClusterCommand

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>,"Nelson Kotowski" <nkotowski(at)gmail(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: TPC-H Scaling Factors X PostgreSQL ClusterCommand
Date: 2007-04-23 18:26:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
>>> On Mon, Apr 23, 2007 at 10:52 AM, in message
<d34b24380704230852p2fe52a05qbd7397a4293ce5a9(at)mail(dot)gmail(dot)com>, "Nelson
Kotowski" <nkotowski(at)gmail(dot)com> wrote: 
>  I don't get how creating only the indexes i cluster on would improve my
> cluster command perfomance. I believed that all other indexes wouldn't
> interfere because so far they're created in a fashionable time and they
> don't refer to any field/column in the orders/lineitem table. Could you
> explain me again?
What a CLUSTER command does is to read through the table in the sequence specified by the index (using the index) and copy the data into a new copy of the table.  It then applies all of the permissions, constraints, etc. from the original table to the copy and builds all the same indexes as were on the original table.  (You can't use the same indexes, because the data is shifted around to new spots.)  The new copy of the table then takes the place of the original.  If you build indexes and then cluster, you throw away the results of the work from the original build, and do it all over again.
> As for the load, when you say the right order to start, you mean i should
> order the load file by the index field in the table before loading it?
If you load the rows in the same order that the index would read them during the cluster, there is no need to cluster and no benefit from doing so.

In response to

pgsql-performance by date

Next:From: Vivek KheraDate: 2007-04-23 20:00:31
Subject: Re: postgres: 100% CPU utilization
Previous:From: Steinar H. GundersonDate: 2007-04-23 17:58:11
Subject: Re: index usage

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group