Re: Speed up "order by"

From: Reinhard Kuhn <rek_at_cas-ps.com>
Date: 1995/10/13
Message-ID: <45mdie$b6b_at_fred.cas-ps.com>#1/1


In article <45fq16$2vi_at_data.interserv.net>, kooiman_at_interserv.com says...
>
>> rz86988_at_mcvax2.d48.lilly.com writes:
>> Does anybody know how to speed up the "order by" clause?
>> [...]
>
>If Oracle has to sort 50,000 rows, it will be slow. But... if you create an
 in
>dex
>on the sorted columns, the Oracle optimizer "should" recognize this, and it
>"should" use the index to retrieve the items in sorted order. This is, of
 cours
>e,
>assuming a lot.
>
>Will.

Of course at least one of the indexed columns had to be declared 'not null' because otherwise the optimizer can't use the index for 'order by' clauses.

( Keys are stored in an index only if they don't consist completely of   null values. For optimizing queries that require the retrieval of rows   in an sorted way the optimizer can use only indexes that are guaranteed   to contain an entry for each row of data. )

-- 
    _/_/_/   _/_/_/ _/    _/  // Reinhard Kuhn             /  It can be      
   _/    _/ _/     _/  _/    //         (kuhn_at_cas-ps.com) /  done quickly,   
  _/_/_/   _/_/_/ _/_/      // CAS GmbH                  /  cheaply or well  
 _/  _/   _/     _/  _/    // Lemberger Strasse 14      /   - pick any two!  
_/   _/  _/_/_/ _/    _/  // 66955 Pirmasens, Germany  /   
                                   
Received on Fri Oct 13 1995 - 00:00:00 CET

Original text of this message