Re: Auto-clustering? - Mailing list pgsql-performance

From Filip Rembiałkowski
Subject Re: Auto-clustering?
Date
Msg-id AANLkTikKC44GqDdbRuxUGGyCyQF8YjB+i71Mgu3Ee3Cm@mail.gmail.com
Whole thread Raw
In response to Re: Auto-clustering?  (Marti Raudsepp <marti@juffo.org>)
List 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@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@filip=# CLUSTER u USING u_t;
CLUSTER
filip@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@juffo.org> napisał:
2010/12/17 Filip Rembiałkowski <filip.rembialkowski@gmail.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

pgsql-performance by date:

Previous
From: "Pierre C"
Date:
Subject: Re: postgres performance tunning
Next
From: "Pierre C"
Date:
Subject: Re: Auto-clustering?