Hi,
I have two tables A and B. Table A is having
55 Million records and B is having 0.3 Million records. I am deleting records from A by joining with B like below.
DELETE
FROM A
INNER JOIN B
ON A.ID = B.ID
In both the tables ID have Indexes.
The above query running longer. I am planning to use Exists clause in that rather than join . Is it improves performance? Else can you guys any other better way.
DELETE
FROM A
WHERE EXISTS (
SELECT B.DID
FROM B
WHERE B.DID = A.DID
)
Thanks in advance,
Gangadhar