After a large amount of data is deleted from an Oracle table, even if there are only a few rows of records in the table, the query using select count (*) from table will not immediately come out because the table has a large space, query is slow. The solution is to reduce the tablespace occupied by the table, or release the tablespace.
Alter table XXXX move; after processing, the tablespace is released. However, after the tablespace is released, the row number rowid of the table changes, and the rowid-based index becomes invalid. Therefore, the index must be rebuilt after this operation. Otherwise, the message "ORA-01502: Index' SMP. ITEMLOG_MID_IDX 'or the partition of this type of index is in the unavailable state. You can drop the index and create it first, but this is too troublesome. It is the fastest way to use alter index XXX rebuild, the original index structure will not be changed.
The author "takes a small step and keeps walking !"