Re: Auto-clustering?

From: Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: Royce Ausburn <royce(at)inomial(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Auto-clustering?
Date: 2010-12-17 10:19:36
Message-ID: AANLkTikKC44GqDdbRuxUGGyCyQF8YjB+i71Mgu3Ee3Cm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

you are right, I must have missed it...

Table "public.u"
Column | Type | Modifiers
--------+-----------------------------+-----------
id | integer |
t | timestamp without time zone |
d | text |
Indexes:
"u_d" btree (d)
"u_id" btree (id)
"u_t" btree (t)

filip(at)filip=# select oid, relname, pg_Relation_size(oid) from pg_class where
relname in('u','u_id','u_t','u_d');
oid | relname | pg_relation_size
-------+---------+------------------
64283 | u | 15187968
64289 | u_id | 6758400
64290 | u_t | 6086656
64291 | u_d | 16482304

filip(at)filip=# CLUSTER u USING u_t;
CLUSTER
filip(at)filip=# select oid, relname, pg_Relation_size(oid) from pg_class where
relname in('u','u_id','u_t','u_d');
oid | relname | pg_relation_size
-------+---------+------------------
64283 | u | 12115968
64289 | u_id | 3391488
64290 | u_t | 3391488
64291 | u_d | 8216576
(4 rows)

So CLUSTER is effectively CLUSTER + REINDEX... nice.

W dniu 17 grudnia 2010 10:41 użytkownik Marti Raudsepp <marti(at)juffo(dot)org>napisał:

> 2010/12/17 Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>:
> > regarding clustering: it does not help with index bloat.
>
> I'm almost sure it does, CLUSTER re-creates all indexes from scratch
> after copying the tuples.
>
> Regards,
> Marti
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Pierre C 2010-12-17 10:20:01 Re: Auto-clustering?
Previous Message Pierre C 2010-12-17 10:07:27 Re: postgres performance tunning