Re: cluster index on a table

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-performance(at)postgresql(dot)org>, "Scara Maccai" <m_lists(at)yahoo(dot)it>
Subject: Re: cluster index on a table
Date: 2009-07-16 20:14:43
Message-ID: 4A5F43E3020000250002886C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Scara Maccai <m_lists(at)yahoo(dot)it> wrote:

> What am I doing wrong?

> [function which uses INSERT/UPDATE/DELETE statements to try to force
> order of rows in heap]

You seem to be assuming that the rows will be in the table in the
sequence of your inserts. You might be better off with a CLUSTER on
some index. (There are a few other options, like TRUNCATE / INSERT or
SELECT INTO / DROP TABLE / ALTER TABLE RENAME -- but CLUSTER is
probably the safest, easiest way to go.)

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Dimitri Fontaine 2009-07-16 20:43:29 Re: Repeated Query is much slower in PostgreSQL8.2.4 than DB2 9.1
Previous Message Kevin Grittner 2009-07-16 20:07:25 Re: Very big insert/join performance problem (bacula)