Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> View vs Underlying Query Performance Question
I have a query that runs fast (second or less). I put this query into a
view minus one condition (userid = '<the users userid>'). When I query
the view and add the condition, the query (see 1 below) is slow
(minutes). I tried running the view without the condition (see 2 below)
and found that it ran in about the same amount of time and the explain
plans were the same. The only difference was the results.
Is this normal behavior? Doesn't Oracle include my condition before running the view's query? I assumed that since a view is a stored query that it would include my condition before processing the request. That isn't what is happening here. Also, I have used this approach before and haven't had an issue.
How should Oracle handle this situation? Will it always run the stored query first before narrowing the results by the conditions added outside of the view? If it should be including my condition what could prevent it from happening?
Thanks! Received on Fri Sep 08 2006 - 07:25:15 CDT
![]() |
![]() |