Delete taking more time

Database
KVB
N/A

Delete taking more time

Hi

Any clueon the below code.

Old code:

DELETE FROM TRANSACTION_ T1
WHERE EXISTS (
SELECT 1
FROM POS_DETAILS T2
WHERE T1.HDR_ID=T2.HDR_ID
AND T1.CNTL_ID<>40
);
takes 6 mins

New code:
DELETE T1 FROM TRANSACTIONT1, POS_DETAILS T2
WHERE T1.HDR_ID=T2.HDR_ID AND T1.CNTL_ID<>40;

takes 7 mins

Any clue on this?
1 REPLY

Re: Delete taking more time

You can check  your explain . Exists usually is faster like in other databases too.