Re: Index usage (subquery with MAX)
Looks right to me.
The 1st query reads all the rows once to complete the work.
The 2nd query needs to read all the rows as well, and for each row it will need to read the table again to find all the matching `name` to get the max of `time`. It uses the index on `name`. Estimated to read about 10% of the table for each of the 5000 rows, so in total you need to evaluate about 5000 multiply by 504 set of data.
DEPENDENT SUBQUERY is bad because it needs to be evaluated once for each of the row in the outer query.
Subject
Views
Written By
Posted
2471
May 03, 2005 04:45PM
Re: Index usage (subquery with MAX)
1689
May 03, 2005 06:36PM
1593
May 04, 2005 09:31AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.