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 -> New to query tuning - question on subquery

New to query tuning - question on subquery

From: Pramod Ramachandran <pramod_at_rtimes.com>
Date: 2 Jun 2004 07:16:12 -0700
Message-ID: <6616e304.0406020616.6620000b@posting.google.com>


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 Received on Wed Jun 02 2004 - 09:16:12 CDT

Original text of this message

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