Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "order by" performance behavior
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
news:1u8c2217apoijr55umjhq6sfb1rjr5brqq_at_4ax.com...
>>
>>select project from (
>>select distinct project from result)
>>order by project; -- returns instanteously --
>>
>> 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3098 Card=43
>>Bytes=2236)
>> 1 0 VIEW (Cost=3098 Card=43 Bytes=2236)
>> 2 1 SORT (UNIQUE) (Cost=3098 Card=43 Bytes=129)
>> 3 2 BITMAP INDEX (FAST FULL SCAN) OF 'IDX_RESULT_PROJECT'
>>
>>------------------------------
>
> Nulls are not being indexed (which you don't need to 'hear', because
> it is documented).
> Consequently those two queries won't return identical results.
If you check the execution plans, you will see that the index in question is a bitmap index - and null values do get recorded in bitmap indexes.
-- Regards Jonathan Lewis http://www.oracle.com/technology/community/oracle_ace/ace1.html#lewis The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html Cost Based Oracle: Fundamentals http://www.jlcomp.demon.co.uk/cbo_book/ind_book.htmlReceived on Sun Mar 26 2006 - 03:06:26 CST