Skip to Content
avatar image
Former Member

what is primary index

hai gurus,

can anybody inform me

what is primary index

thank oyu

kals.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Oct 11, 2007 at 11:30 AM

    hi Kalyan

    The SAP documentation states the following:

    "The primary index is distinguished from the secondary indexes of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database."

    Regards

    Allan Cristian

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 11:46 AM

    Hi

    <b>Primary and secondary indexes</b>

    <b>Index:</b> Technical key of a database table.

    <b>Primary index:</b> The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.

    <b>Secondary index:</b> Additional indexes could be created considering the most frequently accessed dimensions of the table.

    <b>Structure of an Index</b>

    An index can be used to speed up the selection of data records from a table.

    An index can be considered to be a copy of a database table reduced to certain fields. The data is stored in sorted form in this copy. This sorting permits fast access to the records of the table (for example using a binary search). Not all of the fields of the table are contained in the index. The index also contains a pointer from the index entry to the corresponding table entry to permit all the field contents to be read.

    When creating indexes, please note that:

    An index can only be used up to the last specified field in the selection! The fields which are specified in the WHERE clause for a large number of selections should be in the first position.

    Only those fields whose values significantly restrict the amount of data are meaningful in an index.

    When you change a data record of a table, you must adjust the index sorting. Tables whose contents are frequently changed therefore should not have too many indexes.

    Make sure that the indexes on a table are as disjunctive as possible.

    (That is they should contain as few fields in common as possible. If two indexes on a table have a large number of common fields, this could make it more difficult for the optimizer to choose the most selective index.)

    <b>Accessing tables using Indexes</b>

    The database optimizer decides which index on the table should be used by the database to access data records.

    You must distinguish between the primary index and secondary indexes of a table. The primary index contains the key fields of the table. The primary index is automatically created in the database when the table is activated. If a large table is frequently accessed such that it is not possible to apply primary index sorting, you should create secondary indexes for the table.

    The indexes on a table have a three-character index ID. '0' is reserved for the primary index. Customers can create their own indexes on SAP tables; their IDs must begin with Y or Z.

    If the index fields have key function, i.e. they already uniquely identify each record of the table, an index can be called a unique index. This ensures that there are no duplicate index fields in the database.

    When you define a secondary index in the ABAP Dictionary, you can specify whether it should be created on the database when it is activated. Some indexes only result in a gain in performance for certain database systems. You can therefore specify a list of database systems when you define an index. The index is then only created on the specified database systems when activated

    <b>Reward if usefull</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 12:01 PM

    Indexes are use t amke searching faster.

    WHENEVER WE CREATE AND ACTIVATE The table, by default one index has been created and called as primary index.

    primary index is always on teh primary key of table.

    e.g.:- in table VBAK , keys are vbeln.

    By default the index will be on vbeln filed.

    whenevr you will use the slecet statement with vbeln in where class this index will be used.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 12:49 PM

    You can search a table for data records that satisfy certain search criteria faster using an index.

    The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.

    An index can be considered a copy of a database table that has been reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example using a binary search. The index also contains a pointer to the corresponding record of the actual table so that the fields not contained in the index can also be read.

    The primary index is distinguished from the secondary indexes of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 12:51 PM

    Primary index: the primary index contains key fiels of a table and a pointer to non-key fields of the table. The primary index is created automatically when a table is created in database and moreover you can further define reference to the primary index which are known as Secondary index

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 02:05 PM

    HI KALYAN,

    PRIMARY INDEX : INDEX REFERRING TO KEY FIELDS

    THESE PRIMARY & SECONDARY INDEXES , SO THAT WE CAN HAVE FASTER , EFFICIENT & FILTERED ( DESIRED ) RESULT

    BASED ON THE PRIMARY INDEX ONLY , WE CAN DO DIFFERENT OPERATIONS ON TABLES LIKE SORTING, SELECTION OF RECORDS FROM TABLE etc., .

    THE PRIMARY INDEX IS CREATED AUTOMATICALLY WHEN TABLE IS CREATED IN DATABASE.

    WE CAN CREATE SCONDARY INDEX ALSO BASED ON MOST FRQUENTLY USED SELECTION CRITERIA

    ACTUALLY WE R NOT SUPPOSED TO CREATE SECONDARY INDEXES UNNECESSARILY.

    PRIMARY INDEX IS SUFFICIENT.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 12, 2007 at 06:10 AM

    You can search a table for data records that satisfy certain search criteria faster using an index.

    The primary index is distinguished from the secondary indexes of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.

    The system automatically creates the primary index. 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. the primary index contains key fiels of a table and a pointer to non-key fields of the table. The primary index is created automatically when a table is created in database and moreover you can further define reference to the primary index which are known as Secondary index.

    Add comment
    10|10000 characters needed characters exceeded