Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select max
Folowing the note you sent me, I've done a couple of extra tests, and indeed the
select max(indexed column) from table;
does exactly the short circuit that one would hope for - the ambiguity is even eliminated in the 8.1.5 execution plan with the line:
INDEX FULL SCAN (MIN/MAX) The exampe where the 'short cut' does not take place is in:
select max(indexed column)
from table
where indexed_column <= {constant}
This type of query scans the index from the bottom up, and then sorts all the rows found, when it would be more efficient to enter the index at {constant} and work downwards - ...
*(I've added it to my enhancement request list ;)
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
Jonathan Lewis wrote in message
<933337782.17446.0.nnrp-13.9e984b29_at_news.demon.co.uk>...
>
>The interesting thing about that is that Oracle
>will still do a FULL SCAN on the index, and
>sort all the key values to find the max().
>
Received on Fri Jul 30 1999 - 10:24:09 CDT
![]() |
![]() |