最近频繁修改表的字段,可是很奇怪,有些修改完后不会产生reorg pending, 比如int->bigint, 或者加一个新的字段timestamp, 可是有些date->timestamp就会reorg pending, 不知道这个有什么标准,手册里好像没查到!
还有一次更好玩,连续增加了两个字段都没有pending,可再加第三个就pending了!!!
以下内容摘自sql ref
Notes
v A REORG-recommended operation has occurred when changes resulting from anALTER TABLE statement affect the row format of the data. When this occurs,most subsequent operations on the table are restricted until a tablereorganization operation completes successfully. Up to three ALTER TABLEstatements of this type can execute against a table before reorganization must bedone (SQLSTATE 57016). Multiple alterations that would constitute aREORG-recommended operation can be made as part of a single ALTER TABLEstatement (one per column); this is considered to be a singleREORG-recommended operation. For example, dropping two columns in asingle ALTER TABLE statement is not considered to be twoREORG-recommended operations. Dropping two columns in two separateALTER TABLE statements, however, would be regarded as two statements thatcontain REORG-recommended operations.
v The following table operations are allowed after a successfulREORG-recommended operation has occurred:
– ALTER TABLE, where no row data validation is required. However, thefollowing operations are not allowed (SQLSTATE 57007):
- ADD CHECK CONSTRAINT
- ADD REFERENTIAL CONSTRAINT
- ADD UNIQUE CONSTRAINT
- ALTER COLUMN SET NOT NULL
– DROP TABLE
– RENAME TABLE
– REORG TABLE
– TRUNCATE TABLE
– Table scan access of table data
收起
Up to three ALTER TABLEstatements of this type can execute against a table before reorganization must bedone (SQLSTATE 57016).
有哪位有个确切说法没?我一直没搞清什么情况下需要reorg,平时只要alter之后(不管是变长还是变短,还是修改类型),都有可能需要reorg,导致我很困惑。在生产上,我给他们定了个规范,只要alter表,后面都必须reorg
收起