Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Indexes in Oracle 8i?
What you expect as results? Indexes serves to make retrieving data faster.
For example, to get all the records which has ACCOUNT_ID=1 you should not go
through the whole table to recognise the records satisfying given condition,
Oracle takes Index, which is ordered, find the records with ACCOUNT_ID=1 and
gives them in the results.
That is why indexes are usually useful for selective fields (when you are
searching for a rare (<25%) values), otherwise it's sometimes better not to
use indexes.
If you would like to have yours result ordered, you can place ORDER BY close at the and of SELECT statement.
"Raheen Ballard" <rballard34_at_home.com> a écrit dans le message news:
mibz7.137500$5A3.44250624_at_news1.rdc2.pa.home.com...
> Hi! I'm using Oracle 8i personal edition and I was trying out some of
the
> Index exercises in my book (Sam's), but my results don't seem to be
correct.
> For instance, I input:
>
>
> create index ID_INDEX on bills( ACCOUNT_ID );
> ========
> and i get back:
>
> NAME AMOUNT ACCOUNT_ID
> ------------------------------ ---------- --------
--Received on Wed Oct 17 2001 - 03:47:38 CDT
> PHONE COMPANY 125 1
> POWER COMPANY 75 1
> RECORD CLUB 25 2
> SOFTWARE COMPANY 250 1
> CABLE TV COMPANY 35 3
> JOE'S CAR PALACE 350 5
> S.C. STUDENT LOAN 200 6
> FLORIDA WATER COMPANY 20 1
> U-O-US INSURANCE 125 5
> DEBTOR'S CREDIT CARD 35 4
>
> Index created.
> =====================
>
> It tells me that the index was created, but the results are the same as
> if I'd never created the index...am I doing something
> wrong? I've tried it on several other tables, with same results...
>
> Thx!!!
>
>
>
> --
> Check out my site! (Still under construction!)
> http://members.home.net/rballard34/new/
> Sign the guestbook if you like!
>
> -Rah
>
>
![]() |
![]() |