why toast tables are not reindexed while clustering?

Started by SAKATA Tetsuoover 19 years ago3 messageshackers
Jump to latest
#1SAKATA Tetsuo
sakata.tetsuo@oss.ntt.co.jp

Hi,

My name is Tetsuo Sakata.
Now, I'm checking the PostgreSQL's CLUSTER command.
(I read PostgreSQL 8.1.2.)

I found that when clustering a table the toast table associated with
the table is not reindexed.
( reindex_relation() is called while the parameter toast_too is set false.
For this parameter, reindex for the toast table is not done.)

I'll be pleased if someone tell me the reason why
when a table is clustered toast the table is not reindexed.

best regards,

Tetsuo.
--
sakata.tetsuo _at_ oss.ntt.co.jp
SAKATA, Tetsuo. Shinagawa Tokyo JAPAN.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: SAKATA Tetsuo (#1)
Re: why toast tables are not reindexed while clustering?

SAKATA Tetsuo <sakata.tetsuo@oss.ntt.co.jp> writes:

I'll be pleased if someone tell me the reason why
when a table is clustered the toast table is not reindexed.

It's not obvious that those two things should be related. You can
reindex the toast table if you wish ...

regards, tom lane

#3SAKATA Tetsuo
sakata.tetsuo@oss.ntt.co.jp
In reply to: Tom Lane (#2)
Re: why toast tables are not reindexed while clustering?

Thank you for your quick answering my question. > Tom.

Tom Lane wrote:

SAKATA Tetsuo <sakata.tetsuo@oss.ntt.co.jp> writes:

I'll be pleased if someone tell me the reason why
when a table is clustered the toast table is not reindexed.

It's not obvious that those two things should be related. You can
reindex the toast table if you wish ...

I have some thoughts.

(1) If there are no significant reason why two things are related,
we should reindex toast table while clustering.
( I searched PostgreSQL mailing list archive about this topic,
only to fail finding significant discussion.)

(2) If some reasons exist and it is not appropriate to reindex toast table,
we describe it in the PostgreSQL documentation.

(3) And then, giving some way to users that they create index(es)
only on the toast table. Now, when we reindex the table after clustering it,
we create all index(es) on the table that we cluster.
So we create the same index(es) twice.

best regards,

Tetsuo.
--
sakata.tetsuo _at_ oss.ntt.co.jp
SAKATA, Tetsuo. Shinagawa Tokyo JAPAN.