Slow query after a large amount of data is deleted in an Oracle table

Source: Internet
Author: User

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 !"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.