Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Index questions

Index questions

From: <kirk_at_kaybee.org>
Date: 2000/02/15
Message-ID: <88ca9o$2ta$1@news-int.gatech.edu>#1/1

First of all, is it necessary to create an index on the primary key column of a table (as almost every search I do is on the primary key)?

Secondly, I have one table where I will regularly do a search like this: select * from users where u_name = 'blah' and u_index = 10;

In other words, I will reguarly search for table rows based on those two columns together (The two columns, when combined, will be unique, but each column by itself will not be unique).

Is this how I create an index to speed up the mentioned queries?

CREATE unique INDEX username_index on users (u_name asc, u_index asc);

-- 
 Kirk Bauer -- CmpE, Georgia Tech -- kirk_at_kaybee.org -- Avid Linux User
    GT Sport Parachuting Club!  http://cyberbuzz.gatech.edu/skydive
     Opinions expressed are my own, but they should be everybody's.
Received on Tue Feb 15 2000 - 00:00:00 CST

Original text of this message

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