Re: Should I CLUSTER on PRIMARY KEY

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Should I CLUSTER on PRIMARY KEY
Date: 2009-07-20 02:18:58
Message-ID: 20090720021857.GL5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jul 19, 2009 at 08:56:08PM -0400, Robert James wrote:
> Thanks, Chris. Is there a way to do this deterministically, or at least
> programatically? I have code to create the tables and cluster them
> automatically?

As Chris said, the index used by the primary key uses the table name
with "_pkey" append on the end. If you want to figure out how psql is
figuring this out, you can pass it -E when you connect.

Why do you care though? CLUSTERing is a rather limited fix for a rather
specialized type of problem, it's not something that's worth setting
for every table and almost certainly not just blindly doing it on the
table's primary key.

--
Sam http://samason.me.uk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2009-07-20 02:32:15 Re: Best practices for moving UTF8 databases
Previous Message Adrian Klaver 2009-07-20 02:04:33 Re: timestamp with time zone tutorial