SEL COUNT(*) FROM DATABASE_A.QF
Count = 37,011,480
SEL COUNT(*) FROM DATABASE_A_INC.QFA
Count = 368,454
Query 1
DELETE A
FROM
DATABASE_A.QF A,
DATABASE_A_INC.QFA B
WHERE
A.Q_NUM = B.Q_NUM
AND
A.ID = B.ID
AND
A.LOCATION_ID=1;
The above DELETE query runs into SPOOL space issue.
So I rewrote it in another form.
Query 2
DELETE FROM DATABASE_A.QF A WHERE (Q_NUM,ID) IN
(SELECT Q_NUM,ID FROM DATABASE_A_INC.QFA B)
AND LOCATION_ID=1;
368454 rows processed. DELETE Command Complete
My questions:
- Are query 1 and 2 logically the same? Are they deleting the same records?
- How do I verify the count from Query 1 without running into a SPOOL space issue? I have tried a general COUNT function. I tried increasing spool space to a certain extent.
- Is there a better way to check the count for Query 1?