Re: Physical sort of a table
Date: 1995/07/03
Message-ID: <3t9lak$ifd_at_news.fonorola.net>#1/1
In article <vkj.305.2FF02E9E_at_ctt.bellcore.com>, vkj_at_ctt.bellcore.com (Vinod Jain) says:
>
>Hi,
>
>I want to store a table physically sorted on certain columns so that I don't
>have to use 'order by' clause in my 'select ' queries. The 'select' query
>which I am trying to tune has joins with 2 more tables. Does primary key
>index sorts the table (like a clustered index in Sybase) ?
>
>Thanks,
>Vinod
>
Oracle does not have a "clustered index" like SYBASE or DB2 MVS for that
matter. In Oracle you cannot guarentee the physical order of rows. Many
times the rows "happen" to be sorted the right way but there is NO guarentee.
You must use an order by clause. Proper indexing may eliminate the need for
a sort but far from always... By the way you say you don't want to use
'order by' clause in my 'select ' queries why ? I assume it is to avoid a
sort... this can be accomlished in many cases.
In Oracle there is really only way to affect the physical location of rows. This is with "clusters" .... same name as in Sybase, DB2 but quite a different animal.
Regards
GAG
Gerry A. Gilchrist ( GAG ) ObjectWorks Inc. 800, 100-4th Avenue S.W. Calgary, Alberta Canada T2P 3N2 Tel: (403)237-7333 E-Mail: gag_at_objectworks.com WWW: http://www.objectworks.com ***************************************************************************************Received on Mon Jul 03 1995 - 00:00:00 CEST