Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: query optimization
It is not clear to me from your question if you drop the index on the ID column (at least in table A) before the DELETE operation. It could be more harmful than useful. If not, you could try these steps:
DELETE FROM a
WHERE id IN
(SELECT /*+ FULL(a) PARALLEL(a, n) */ id
FROM a
MINUS
SELECT /*+ FULL(b) PARALLEL(b, n) */ id
FROM b
);
where n is an integer representing the degree of parallelism you want for the SELECTs in your subquery.
3. After the DELETE, re-create the index you dropped in Step 1. Use CREATE INDEX with the UNRECOVERABLE clause to speed things up, although, since you have fewer rows in table A, the index should be created really fast.
Hope this helps.
Michael Serbanescu
![]() |
![]() |