Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: New to query tuning - question on subquery

Re: New to query tuning - question on subquery

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 02 Jun 2004 12:30:30 -0700
Message-ID: <1086204639.60732@yasure>


Pramod Ramachandran wrote:
> Hi group,
>
> I am new to query tuning activities and here is my question. I have a
> certain complex query, which takes so much time when given a condition
> in the where clause. I dont know why is this behaviour since I did not
> have time to dig into the query (created by someone else. This is my
> new job) since it was a matter of urgency. To my surprise the query
> performs well when the condition is taken off. So I tried the
> following
>
> SELECT VALUE1, VALUE2.... FROM
> (...query...)
> WHERE VALUE1 = VALUE2;
>
> The where clause which was previously inside the query was taked out.
> But this even fails to complete. What I thought was Oracle first would
> execute the subquery and then do the filter. Is this because Oracle
> rearranges the query altogether ? I use 8i with CBO enabled. All
> tables involved are analyzed.
>
> One more question - will hints given inside a view be ignored by the
> optimizer if another hint is given in the main query using this view.
> If so how do I override this behavior ?
>
> Thanks in advance.
>
> Pramod R

Run EXPLAIN PLAN.
http://www.psoug.org/reference/explain_plan.html

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed Jun 02 2004 - 14:30:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US