Cursor with subquery takes forever when using different field

From: Don Seiler <don_at_seiler.us>
Date: 6 May 2003 08:57:45 -0700
Message-ID: <94e86aed.0305060757.5304c29f_at_posting.google.com>


I have a stored proc on an Oracle 7.3.4 database that has a query that goes something like this:

CURSOR my_cur IS
SELECT field1
  FROM table1
 WHERE blah = in_blah
   AND field1 NOT IN (SELECT other_field

                      FROM table2
                      WHERE blash = in_blah)

However we are changing table2 to use another_field instead of other_field and will be dropping other_field altogether. However when I change the cursor subquery to use table2.another_field it takes FOREVER. I don't recall if my developer was ever able to allow the query to finish.

table1.field1 is char(10). table2.other_field varchar2(32) and table2.another_field is varchar2(15). There are corresponding indexes on another_field that exist for other_field, and the query uses those indexes, but it still appears to hang. Received on Tue May 06 2003 - 17:57:45 CEST

Original text of this message