Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

unique index

Former Member
0 Likes
1,856

hi all,

i wanna know that what is the significance of unique index if primary index is already there?

thanks

shweta

hi all,

i wanna know that what is the significance of unique index if primary index is already there?

thanks

shweta

7 REPLIES 7
Read only

Former Member
0 Likes
1,685

Hi Shweta,

Welcome to SDN !!!.....

In SAP basically there are two types of indexes are there

Primary Index

Secondary Index.

Primary Index: This is basically bydefault key which is used to identify any instance of record.

But there are other cases where you need to identify the record on the basis of non key value in that case we use the Secondary index...

Thanks,

Chidanand

Read only

Former Member
0 Likes
1,685

Hi Shweta,

An entry in an index can refer to several records that have the same values for the index fields. A unique index does not permit these multiple entries. The index fields of a unique index thus have key function, that is they already uniquely identify each record of the table.

The primary index of a table is always a unique index since the index fields form the key of the table, uniquely identifying each data record.

You can define a secondary index as a unique index when you create it. This ensures that there are no double records in the table fields contained in the index. An attempt to maintain an entry violating this condition in the table results in termination due to a database error.

If the index fields represent the primary keys of the table, that is, if they already uniquely identify each record of the table, the index is referred to as an unique index.

For more details go through the links.

http://help.sap.com/erp2005_ehp_03/helpdata/EN/9b/c743f5b40711d194f900a0c929b3c3/frameset.htm

http://help.sap.com/erp2005_ehp_03/helpdata/EN/c4/3a7187505211d189550000e829fbbd/frameset.htm

http://help.sap.com/erp2005_ehp_03/helpdata/EN/cc/7c58b369022e46b629bdd93d705c8c/frameset.htm

Read only

Former Member
0 Likes
1,685

why do we create unique index if primary index is there because primary index is also uniquely identify a record in a table and doesnt permit duplicate records.so what is the significance of unique index ?

Edited by: shweta gupta on Oct 13, 2008 7:52 AM

Read only

0 Likes
1,685

Swetha,

What do you mean by Unique index? Only Primary index is unique index for a table.

Secondary indices will allow duplicate entries.

What do you exactly want to know?

Cheers,

Kothand

Read only

Former Member
0 Likes
1,685

hi,

indexes r used for fetching data from tables faster....

indexes r of two types :

=>primary

=>secondary

suppose a primary index has two fields and in ur select query u r using that primary index(by using those two fields in ur where clause of select statement),then the search in the tables w.r.t. select query will be faster as index comes into place...

if ur where clause in select statement doesn't corresponds to an index,one can create a secondary index,THIS WHERE THE QUESTION OF UNIQUE INDEX COMES

Edited by: siddharth kumar on Oct 13, 2008 7:59 AM

Read only

Former Member
0 Likes
1,685

Hi Shweta,

Good question, the primary Index is also a unique index but can only contain the all key fields of the table where as you can define a unique index by using any combination of fields in the table (which is nothing but sec index)

Regards,

Hussain

Read only

siva123hana
Explorer
0 Likes
1,685

Hello,

Whether unique Index on SID table will be created automatically or do we need to the run the program: RSDG_IOBJ_DUPLICATE_SID_CHECK ?

Thanks

Siva