Re: Query : Understand and Re-write

From: John Hurley <hurleyjohnb_at_yahoo.com>
Date: Thu, 25 Mar 2010 05:45:25 -0700 (PDT)
Message-ID: <be1bc182-72bb-466d-8b3c-ff0f94601034_at_g4g2000yqa.googlegroups.com>



On Mar 25, 3:43 am, raja <dextersu..._at_gmail.com> wrote:

snip

> Thanks for all your immediate responses.
>
> AWR Report showed this query in one of the top list.
> I was not able to understand this query. So though posting here would
> give me immediate ideas to move forward.
>
> ok. from my observation.
> there is a UNION ( with 2 queries ), then there are having filter
> condition as TABLE.
> 1st query : trying to take list of table and view using ALL_OBJECTS
> 2nd query : trying to take list of SYNONYMS, TABLES, VIEWS using
> ALL_OBJECTS, ALL_SYNONYMS ( with unnecessary joining ALL_OBJECTS twice
> and then with ALL_SYNONYMS )
>
> Finally taking the output, filtering to take table names alone.
>
> To rewrite the query :  I felt why shouldnt we just use ALL_OBJECTS to
> take the list of table_names alone !!!
> Comments : Collecting gather stats is waste, as the tables/views are
> all related to METADATA ( system related )
>
> Am i right ?
>
> Please help.
>
> With Regards,
> Raja.

Find out who is running the query and ask them why they are running it and what they think it is giving them.

You don't tune everything that shows up in an AWR report you tune things that make a difference to your business. Received on Thu Mar 25 2010 - 07:45:25 CDT

Original text of this message