Re: Measuring degredation of CLUSTER INDEX operation

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Bryce Nesbitt" <bryce2(at)obviously(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Measuring degredation of CLUSTER INDEX operation
Date: 2008-11-10 23:37:29
Message-ID: dcc563d10811101537m6f546b01m3ed899e75049244@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Nov 10, 2008 at 12:54 PM, Bryce Nesbitt <bryce2(at)obviously(dot)com> wrote:
> I've got a table for which "CLUSTER tablename USING index" makes an order of
> magnitude difference.
>
> Are there ways to determine how "unclustered" this table becomes over time,
> so I can schedule downtime to recluster? I could use the pg_stat tables,
> but this seems awkward.

You should be able to run analyze then select correlation from
pg_stats where schemaname='yourschename' and
tablename='yourtablename';

the closer you are to 1.0 the better the clustering.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Craig Ringer 2008-11-11 03:28:14 Re: [PERFORM] Can we activate WAL runtime?
Previous Message Bryce Nesbitt 2008-11-10 19:54:46 Measuring degredation of CLUSTER INDEX operation