BJCooperIT
Programmer
Let me preface this by the fact that I have no control over this recursive table. I simply was asked to find out why a batch job was not running. The indexes on license_tab in 8i are the same as in 9i (red columns are indexed). This query runs in 8i in 2 milliseconds:
However in 9i, it goes out to lunch and finally dies on a rollback error, The 9i explain plan shows a full table scan not in the 8i plan. If I change the "IN" to "=" it runs just fine. I thought this might have to do with whether the tables have been analyzed recently but encountered some user "resistance" to this theory. Any ideas on how I should proceed?
Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: www.EmuProductsPlus.com
Code:
SELECT license
FROM license_tab
WHERE [COLOR=red]fkdi[/color red] IN
(SELECT fkdi
FROM license_tab
WHERE [COLOR=red]license[/color red] = 'Z50438522610')
AND fkbl IS NOT NULL
Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: www.EmuProductsPlus.com