ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ 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@xxxxxxxxx> napisaÅ:
2010/12/17 Filip RembiaÅkowski <filip.rembialkowski@xxxxxxxxx>:
> 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