Re: Should I CLUSTER on PRIMARY KEY - Mailing list pgsql-general

From Sam Mason
Subject Re: Should I CLUSTER on PRIMARY KEY
Date
Msg-id 20090720021857.GL5407@samason.me.uk
Whole thread Raw
In response to Re: Should I CLUSTER on PRIMARY KEY  (Robert James <srobertjames@gmail.com>)
List 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/

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: timestamp with time zone tutorial
Next
From: Phoenix Kiula
Date:
Subject: Re: Best practices for moving UTF8 databases