Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Unique and non unique index
> > No the primary key index will always create the unique index.
> > The Non unique index are required to be created for faster data
> > retrieval and not for maintaining data integrity.
>
> Your information is incorrect.
> ---------------------------------------------------------------------
> SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 15 08:52:21 2006
>
> Copyright (c) 1982, 2005, Oracle. All rights reserved.
>
> Connected to:
> Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
> With the Partitioning, OLAP and Data Mining options
>
> SQL> create table t (
> 2 col1 NUMBER(3),
> 3 col2 VARCHAR2(10));
>
> Table created.
>
> SQL> ALTER TABLE t
> 2 ADD CONSTRAINT pk_t
> 3 PRIMARY KEY (col1)
> 4 INITIALLY DEFERRED DEFERRABLE
> 5 USING INDEX
>
> Table altered.
>
> SQL> SELECT index_name, index_type, uniqueness
> 2 FROM user_indexes
>
> INDEX_NAME INDEX_TYPE UNIQUENES
> ------------------------------ --------------------------- ---------
> PK_T NORMAL NONUNIQUE
>
>
> Oracle can use either unique or non-unique indexes to support a primary
> key constraint.
Interesting. Would I be correct in assuming that it would take slightly more cycles to check for matches against this index?
-- Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL Server Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.comReceived on Wed Mar 15 2006 - 16:42:25 CST