Re: Slow data dictionary query from all_synonyms fixsyn script
Date: Wed, 26 Mar 2008 17:28:45 -0700 (PDT)
On Mar 26, 12:54 am, Kirmo Uusitalo <n..._at_exists.com.invalid> wrote:
> I've developed a script file which fixes (creates or drops) synonym
> statements for all users which have been granted access for current
> user's objects. It can even trace the privileges inherited through
> It works OK but the performance is way too slow if the database is
> I have traced the problem to this sql satement:
> SELECT owner
> FROM all_synonyms
> WHERE table_name = UPPER ('EMP')
> AND synonym_name = UPPER ('EMP')
> AND table_owner = 'SCOTT'
> AND (owner = 'SYSTEM' OR owner = 'PUBLIC');
> The explain plan for this rather simple query looks like this!
> (I am using Oracle 10.2.0.2.0 on Windows platform:
> Am I doing something wrong as the explain plan looks rather complex
> for this simple query?
Remember, all_synonyms is a view, with exists and unions. You may have more luck dealing with the underlying tables. Or maybe David's suggestion will be good enough for the optimizer to sort through all that stuff.
-- @home.com is bogus. Hey, that's what I started on: http://www.nytimes.com/2008/03/23/technology/23digi.html?_r=1&oref=sloginReceived on Wed Mar 26 2008 - 19:28:45 CDT