DELETE FROM BATCH_T WHERE BatchId In ( BatchIdList ) AND Status = 'CLOSED'
The above query is taking 3 mins to finish. Can anybody help me to reduce the response time.
If the batch list be small, then consider adding the following index to your table:
CREATE INDEX batch_idx ON BATCH_T (BatchId, Status);
If you have a very long batch list, then consider adding those values to a new table BATCH_LIST. Then, make sure that the following index exists on this new table:
CREATE INDEX other_idx ON BATCH_LIST (BatchId);
The first index should help either version.