Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

DELETE with index and without index

976208Feb 2 2015 — edited Feb 2 2015

Hi All,

DELETE FROM customer_history

WHERE cust_type='SNB';

The "customer_history" table is having 255045688 records.

The table is having some indexes.

CREATE TABLE Customer_hstory (

  Cust_ID   NUMBER(3) NOT NULL,

  Cust_Name VARCHAR2(30) NOT NULL,

  cust_reg   VARCHAR2(20) ,

  City     VARCHAR2(20) ,

  cust_type    CHAR(4) ,

  Zip      VARCHAR2(10),

  reg_code    VARCHAR2(12),

  PRIMARY KEY (Cust_ID)

);

CREATE INDEX idx_cust_name ON Customer_hstory(cust_name);

CREATE INDEX idx_cust_type ON Customer_hstory(cust_type);

CREATE INDEX idx_reg_code ON Customer_hstory(reg_code);

As per my knowledge when we are performing DML operations on a table the index blocks has to update

so the DML operations slow down.

So before starting DELETE I have to drop all indexes on the table

and recreate once DELETE is completed?

Else I have to drop some spicified indexes?

Else no need to drop indexes?

While performing DELETE should we keep index (or) DELETE index for better performance?

Please help me.

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2015
Added on Feb 2 2015
8 comments
6,039 views