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

Primary Index

Former Member
0 Likes
1,829

hi Experts,

1,What is the difference between primary index and secondary index?

2,what is the difference between pooled tables and cluster tables?

I need some Important differnce for both questions. Please say.

1 ACCEPTED SOLUTION

hi Experts,

1,What is the difference between primary index and secondary index?

2,what is the difference between pooled tables and cluster tables?

I need some Important differnce for both questions. Please say.

7 REPLIES 7
Read only

Former Member
0 Likes
1,423

Hi,

1)What is the difference between primary index and secondary index?

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/frameset.htm

A difference is made between Primary & Secondary indexes to a table. the primary index consists of the key fields of the table and a pointer to the non-keys-fields of the table. The Primary index is generated automatically when a table is created and is created in the datebase as the same times as the table. It is also possible to define further indexes to a table in the ABAP/4 dictionary, which are then referred to as Secondary indexes.

2)pooled and cluster:

http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21f083446011d189700000e8322d00/frameset.htm

<b>also this thread:</b>

rgds,

latheesh

Message was edited by: Latheesh Kaduthara

Message was edited by: Latheesh Kaduthara

Read only

Former Member
0 Likes
1,423

Hello Bala,

1. The primary index of a table is equal to the key(s) of the table. All other indexes are combinations of fields of the table to enhance performance when reading from the table.

2. Cluster tables are used to store (large) texts, e.g. documentation.

Regards,

John.

Read only

Former Member
0 Likes
1,423

Hi bala,

1. What is the difference between primary index and secondary index?

Primary index : Its the index which is automatically created for the PRIMARY KEY FIELD(S) of the table.

Secondary index : Its created as and when required,

based upon other field(s) of the table,

on which search criteria is used in sqls.

2. what is the difference between pooled tables and cluster tables

Cluster Table : One record in cluster physical table,

has one RAW Column, which stores encoded data,

which can be decoded and we can get information

in MANY INTERNAL TABLEs.

(that whole information is related to that particular record only)

POOLED Table.

One phyical record of pooled table, contains

only one record of the related table.

Another physcial record of pooled table,

may contain one record of another table.

and so on...

(The primary key information is also maintained in the record)

regards,

amit m.

Read only

Former Member
0 Likes
1,423

Hi Bala,

1.

<b>Primary Index</b>

The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE.

<b>Secondary index</b>

Secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible. The fewer table entries that can be selected by a certain column, the higher that column’s selectivity. Place the most selective fields at the beginning of the index. Your secondary index should be so selective that each index entry corresponds to at most five percent of the table entries. If this is not the case, it is not worth creating the index. You should also avoid creating indexes for fields that are not always filled, where their value is initial for most entries in the table.

2.

You may refer to this section of the help :

http://help.sap.com/saphelp_46c/helpdata/en/4f/991f82446d11d189700000e8322d00/frameset.htm

<b>Pool table</b>

A database table defined in the ABAP Dictionary whose database instance is assigned to more than one table defined in the ABAP Dictionary. Multiple pool tables are assigned to a table pool in the database. The key fields of a pool table have to be character-type fields. The table pool's primary key consists of two fields: TABNAME for the name of a pool table, and VARKEY for the interdependent contents of the key fields in the corresponding pool table. The non-key fields of the pool table are stored in compressed format in their own column, called VARDATA, of the table pool. The only way to access pool tables is by using Open SQL. Joins are not allowed.

<b>Cluster Table</b>

Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. You can access cluster tables only via Open SQL, and only without using joins.

Table Cluster

Database table in the database that contains the data of several cluster tables

Read only

Former Member
0 Likes
1,423

Hi

check http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21f083446011d189700000e8322d00/frameset.htm

for cluster table and pooled table differences.

and

Database Indices are used for faster access of data. Mostly primary indices contain the key fields and other important fields that are commonly accessed are used as secondary indices. You should not have more than 5 secondary keys.

Regards

navneet

Read only

Former Member
0 Likes
1,423

Hi Bala,

<b>Pooled Table</b> : Pooled tables are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to store control data. Several pooled tables can be cominied in a table pool. The data of these pooled tables are then sorted in a common table in the database.

<b>Cluster Table</b> : Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to strore control data. They can also be used to store temporary data or texts, such as documentation.

For Diff b/w primary and secondary indexes u can go thru th link,

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb20446011d189700000e8322d00/content.htm

For Futher info , u can visit the below link.

http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm

Regards,

Kiran B