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 -> Re: select max

Re: select max

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 30 Jul 1999 16:24:09 +0100
Message-ID: <933348556.5618.2.nnrp-03.9e984b29@news.demon.co.uk>

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

Original text of this message

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