Hi,
Let us take a query like this
1).select * from tab
group by col1,col2
having
and clause 1
and caluse 2
and clause 3
and clause4=MAX(value)
now take this query
2).select * from tab
where
clause 1
and caluse 2
and clause 3
group by col1,col2
having
and clause 1
and caluse 2
and clause 3
and clause4=MAX(value)
Although the results of both the query are the same but the cost of the 2 nd query is lesser.If we check the query plan
what we see is:-
For query 2 the STEP 1 on table tab is a table scan
Now can anyone please throw some light on how the where caluse is basically causing a modification in this query plan?
Thanks in advance
Somnath
Let us take a query like this
1).select * from tab
group by col1,col2
having
and clause 1
and caluse 2
and clause 3
and clause4=MAX(value)
now take this query
2).select * from tab
where
clause 1
and caluse 2
and clause 3
group by col1,col2
having
and clause 1
and caluse 2
and clause 3
and clause4=MAX(value)
Although the results of both the query are the same but the cost of the 2 nd query is lesser.If we check the query plan
what we see is:-
For query 2 the STEP 1 on table tab is a table scan
Now can anyone please throw some light on how the where caluse is basically causing a modification in this query plan?
Thanks in advance
Somnath