Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update sql is too slow with a big sub-query

Stanley Lee-OracleJul 21 2010 — edited Jul 21 2010
Hi, I have an update statement with an inner query. This is what I am using right now.

UPDATE tableA
set status = 'new'
WHERE
ID not in (SELECT id from tableB)

Since I only want to update records in tableA where ID is not in TableB, the subquery is there. However the sub query can be 100,000 records and that hangs the update stmt.

Any advice? Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2010
Added on Jul 21 2010
5 comments
2,080 views