Guidelines to create secondary index

Hi Guys,
I'm trying to get a guidelines to create an optimize secondary index. For eg, how to analyze the list of fields should be included into the secondary index. What can be done and not.
Pls place your comment.
Thanks in advance.

Hi,
Basically index are provided to improver performance. i.e with index select on database tables retrieves data much faster.
If you are writting select statement on the table where in where clause you have non-primary keys then it takes longer to retriev data from Database table.
If you have select in dbtable on non-primary key you can create Secondary index with keys as per your where clause which result in faster Database table access.
But remember not to create too many secondary indexes on same table which could result in slow / degrage performance..
and also check this link :
http://help.sap.com/saphelp_470/helpdata/en/cf/21eb20446011d189700000e8322d00/frameset.htm
Regards
Appana

Similar Messages

  • What is the "No database index" means when you Creating Secondary Indexes?

    HI,
       I'm Creating Secondary Indexes in the maintenance screen of the table(se11)
       There are three options under "Non-unique Index":
       1.Index on all database systems
       2.For selected database systems
       3.No database index
    My questions is :
      What do u mean by "No Database Index" and when is it used.
      Can anybody plz tell me what's the difference of this three options ?
      Here is what i found in the help:
       No database index: The index is not created in the database. If you
       choose this option for an index that already exists in the database,
       it is deleted when you activate this option.

    Hi,
    It is clear from the help documentation,
    Here see what the help document says:
    Create the index in the database (selection)
    Whether an index improves or worsens performance often depends on the database system. You can therefore set whether an index defined in the ABAP Dictionary should be created in the database.
    This makes it easier to install a platform-specific customer system.
    You can set this option as follows:
    1. Index in all database systems: The index is always created in the database.
    2. In selected database systems: The index is created depending on the database system used. In this option, you must specify the databases in which the indexes are to be created. You can do this either on an inclusive (list of systems on which it should be created) or an exclusinve (list of systems on which it should not be created) basis. In either case, you can list up to four different database systems.
    3. No database index:: The index is not created in the database. If you set this option for an index that already exists in the database, it is deleted when you activate the table in the ABAP Dictionary.
    Note: Unique indexes have an extra function, and must therefore always be created in the database. The database system prevents entries or index fields being duplicated. Since programs may rely on this database function, you cannot delete unique indexes from the database.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • Is it worth creating secondary index on BKPF table ?

    Hello,
    One of my clients is using ECC version 5.0. I have a requirement wherein I need to fetch the data from BKPF table based on AWKEY, BUKRS and GJAHR. There is no standard secondary index available.
    I have decided to create a secondary index on these fields in the following order:
    1) MANDT
    2) AWKEY
    3) BUKRS
    4) GJAHR
    I know that creating secondary indexes does improve performance during data retrieval. But when I checked the total number of entries in BKPF table in production system, there are more than 20 lac 2 million records.
    I am worried that creation of secondary index will create another table of such a large size in production that has data sorted on the above fields. Also, the RAM of production system is 6 GB.
    Please suggest if creation of secondary index is a good measure OR should I recommend the client to increase the system RAM?
    Regards,
    Danish.
    Edited by: Thomas Zloch on Oct 3, 2011 3:01 PM

    Hi,
    Secondary Index on BKPF-AWKEY has been successfully created in production. The report which used to timeout in foreground as well as in background is now executing in less than 10 seconds !!
    Client is very much satisfied with this. But, there is one problem that we are facing now is that when the user is changing an existing billing document via VF02, on SAVE, system takes a very long time to save the changes done.
    We monitored the processes via SM50 and found that there was a sequential read on BKPF table.
    Before transporting the index in production, system approximately took not more than 5 seconds to save the Billing Document. But now system takes more than 20 minutes just to save the billing document via VF02.
    I really don't know what has gone wrong. I can't figure out if I have missed any step while creating the index.
    I did the following,
    1) Created a Secondary index on BKPF, saved it in the transport request and activated it. Since the index was not existing in database ORACLE, I activated and adjusted the table via SE14. Now, index exists on database as well. Working perfectly in development.
    2) Imported the transport request to Production. Checked in SE11. Index was existing and active. Also, index existed in database ORACLE.
    Have I missed anything ? Is it required to activate and adjust the database via SE14 in production too ?
    Regards,
    Danish.

  • Can we create secondary indexes in pooled and cluster table?

    hello all
    can we create secondary indexes in pooled and cluster table?

    Hi,
    Yes, you can.
    Refer the below links
    [http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm|http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm]
    [http://help.sap.com/saphelp_40b/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm|http://help.sap.com/saphelp_40b/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm]
    Regards,
    SB

  • Can we create secondary index for a cluster table

    hi
    can we create secondary index for a cluster table

    Jyothsna,
    There seems to be some kind of misunderstanding here. You <i>cannot</i> create a secondary index on a cluster table. A cluster table does not exist as a separate physical table in the database; it is part of a "physical cluster". In the case of BSEG for instance, the physical cluster is RFBLG. The only fields of the cluster table that also exist as fields of the physical cluster are the leading fields of the primary key. Taking again BSEG as the example, the primary key includes the fields MANDT, BUKRS, BELNR, GJAHR, BUZEI. If you look at the structure of the RFBLG table, you will see that it has primary key fields MANDT, BUKRS, BELNR, GJAHR, PAGENO. The first four fields are those that all cluster tables inside BSEG have in common. The fifth field, PAGENO, is a "technical" field giving the sequence number of the current record in the series of cluster records sharing the same primary key.
    All the "functional" fields of the cluster table (for BSEG this is field BUZEI and everything beyond that) exist only inside a raw binary object. The database does not know about these fields, it only sees the raw object (the field VARDATA of the physical cluster). Since the field does not exist in the database, it is impossible to create a secondary index on it. If you try to create a secondary index on a cluster table in transaction SE11, you will therefore rightly get the error "Index maintenance only possible for transparent tables".
    Theoretically you could get around this by converting the cluster table to a transparent table. You can do this in the SAP dictionary. However, in practice this is almost never a good solution. The table becomes much larger (clusters are compressed) and you lose the advantage that related records are stored close to each other (the main reason for having cluster tables in the first place). Apart from the performance and disk space hit, converting a big cluster table like BSEG to transparent would take extremely long.
    In cases where "indexing" of fields of a cluster table is worthwhile, SAP has constructed "indexing tables" around the cluster. For example, around BSEG there are transparent tables like BSIS, BSAS, etc. Other clusters normally do not have this, but that simply means there is no reason for having it. I have worked with the SAP dictionary for over 12 years and I have never met a single case where it was necessary to convert a cluster to transparent.
    If you try to select on specific values of a non-transparent field in a cluster without also specifying selections for the primary key, then the database will have to do a serial read of the whole physical cluster (and the ABAP DB interface will have to decompress every single record to extract the fields). The performance of that is monstrous -- maybe that was the reason of your question. However, the solution then is (in the case of BSEG) to query via one of the index tables (where you are free to create secondary indexes since those tables are transparent).
    Hope this clarifies things,
    Mark

  • Creating secondary index

    Hi all,
    Plz explain me how to create secondary index.
    How to generate interactive report using ALV.
    Thanks in advance
    Venkat

    GO to Resuse library ther 'SE83' there you will find interavtive alv demo programs.
    GO to SE11 and open the table. you will find 'Indexes' button in application tool bar to create indexes for table.
    Regards,
    Wasim Ahmed
    Message was edited by: Wasim Ahmed

  • Is it possible to created secondary indexes on ODS in Production

    Hi,
    Is it possible to created secondary indexes on ODS in Production System. I need to create secondary indexes on ODS but it is already in production. Hence Can I directly create secondary indexes without transportation from dev to production?

    Hi,
    Secondary Indexes for DSO can be transported. For the transport the DSO objects needs to be transported (R3TR ODSO <technical name>.
    Additionally, secondary Indexes are necessary quite often for DSO tables, which can be transported. In few cases you need indexes on other BW tables, but they cannot be transported. Never create additional Indexes on InfoCube tables (like E- and F-Fact tables and Dimension tables)
    Thanks & B.R.
    Vince

  • How to create secondary indexes in DB2e from MI

    Hello,
    we need to create secondary indexes in the DB2e SyncBO tables for a SynBO containing several thousands entries.
    We create it manually and works fine, but we have to distribute
    this to every user (about 300).
    Is there a way to distribuite this index creation for an
    application from a central location (WebConsole)?
    Or,
    is there any attribute in the SyncBO definitions for creating indexes on selected fields in teh database?
    Thanks in advance and best regards,
    Angel

    Hi,
    I found the way to create the indexes. In the metadata
    function of the SyncBO builder, you can mark any field
    as index (either in the header or in the detail tables).
    This creates a secondary index in the database per marked
    field.
    Regards,
    Angel

  • How to create Secondary Index?

    Hello All
    Can anyone let me know how to create secondary indexes?
    I hope Primary Indexes are being created automatically?V can'nt able to create this.
    regards
    balji

    Hi,
    1) Go to Se11 select table /BI0/A<ODS>00 > Utilities> Data bse Object --> Check.
    2) If you are using ODS Active table in any Start routine ,Make sure that the order of objects to be seleccted (select statement) should be in same order of index fields.
    In Query, Use RSRT to know the SQL statement of the Query .and follow same logic explained above.
    3) No need to create Secondary Index for Cube.
    4) IT recreates the Index.
    With rgds,
    Anil Kumar Sharma .P

  • How to use secondary index

    Hi abapers,
    Iam creating secondary index for the database table MSEG. ....How to write select query for the secondary index that i have created..
    Regards,
    Ramya

    how to create secondary index in tables
    https://forums.sdn.sap.com/click.jspa?searchID=933015&messageID=2971112
    Guidelines to create secondary index
    https://forums.sdn.sap.com/click.jspa?searchID=933015&messageID=2009801
    Secondary index;
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm
    this will definitely help you, dont forget to award points if found helpful

  • Help me with Points to be noted While creating a Secondary Index.

    Hi,
    There is a Secondary index created on a Z table which already have 9 secondary indexes. This is the 10th index that is created.
    The Index is created as follows
    MANDT             Client
    DOCNUM_REF     Document number
    The Table data is huge and it is more than 4Lakh records.
    I have done the following analyses.
    1) The fields to be used are not in any other indexes.
    2) The Data is mostly different, i.e. The document reference field is having distinct data
      select a~docnum a~werks_o a~docnum_ref a~natop
             a~m_icms a~m_ipi
             b~lgort_out b~mov_est
             b~item b~matnr
        appending table ti_requisicoes
        from zsytmm_reqnfcb as a
       inner join zsytmm_reqnfit as b
          on a~branch_o eq b~branch_o
         and a~requi    eq b~requi
         and a~mask     eq b~mask
         for all entries in ti_doc_saida_del
       where a~docnum_ref   eq ti_doc_saida_del-docnum.
    What else I need to check , so that the index improves the performance. The table is using in 300 reports.

    Ravishankar Lanjewar wrote:
    @SAP LEARNER,
    >
    > There is a Secondary index created on a Z table which already have 9 secondary
    > indexes. This is the 10th index that is created.
    >
    >
    > I will not recommand to create index any more on this table. If you want to create secondary index for on above table which you have mention. You don't create index only for hamper of performance of single program/report.
    >
    > Don't create more than 4 to 5 index on sinlge table.
    >
    > Refere the tread Link:[Why to create Secondary index ?|Re: When is a secondary index used (in select or where)]
    Sounds like another myth that is widely spread across SAP community.
    Remember, complex systems like modern DBMS do not like generalizations. I personally know standard SAP tables with 9 standard secondary indexes. In the meantime the hardware became fast enough to update several secondary indexes without really significant problems. Of course indexes require space, of course one should create indexes that are not similar and differ from each other with more than one field for example. In other words, think before creating!
    But it's again incorrect to say "do not create because you already have 9 others". You did not even ask what fields are in the affected table, what are the existing indexes.
    Ravishankar Lanjewar wrote:
    > I will recommand to delete all the index and create 4 to 5 fresh index while doing analysis for all SQL statement using where use list  depends on where condition of SQL.
    I am now trying to imagine the effort to analyze 300 reports using this table and all corresponding selects. And probably you will drop supporting indexes for several reports. Some of them may be CEO/CFO-relevant reports that will run minutes/hours instead of seconds. And I would like to see the reaction of CEO when he finds out that it was the result of your "optimization" activities.

  • How many SECONDARY INDEXES are created for CLUSTER TABLES?

    how many SECONDARY INDEXES are created for CLUSTER TABLES?
    please explain.

    There seems to be some kind of misunderstanding here. You cannot create a secondary index on a cluster table. A cluster table does not exist as a separate physical table in the database; it is part of a "physical cluster". In the case of BSEG for instance, the physical cluster is RFBLG. The only fields of the cluster table that also exist as fields of the physical cluster are the leading fields of the primary key. Taking again BSEG as the example, the primary key includes the fields MANDT, BUKRS, BELNR, GJAHR, BUZEI. If you look at the structure of the RFBLG table, you will see that it has primary key fields MANDT, BUKRS, BELNR, GJAHR, PAGENO. The first four fields are those that all cluster tables inside BSEG have in common. The fifth field, PAGENO, is a "technical" field giving the sequence number of the current record in the series of cluster records sharing the same primary key.
    All the "functional" fields of the cluster table (for BSEG this is field BUZEI and everything beyond that) exist only inside a raw binary object. The database does not know about these fields, it only sees the raw object (the field VARDATA of the physical cluster). Since the field does not exist in the database, it is impossible to create a secondary index on it. If you try to create a secondary index on a cluster table in transaction SE11, you will therefore rightly get the error "Index maintenance only possible for transparent tables".
    Theoretically you could get around this by converting the cluster table to a transparent table. You can do this in the SAP dictionary. However, in practice this is almost never a good solution. The table becomes much larger (clusters are compressed) and you lose the advantage that related records are stored close to each other (the main reason for having cluster tables in the first place). Apart from the performance and disk space hit, converting a big cluster table like BSEG to transparent would take extremely long.
    In cases where "indexing" of fields of a cluster table is worthwhile, SAP has constructed "indexing tables" around the cluster. For example, around BSEG there are transparent tables like BSIS, BSAS, etc. Other clusters normally do not have this, but that simply means there is no reason for having it. I have worked with the SAP dictionary for over 12 years and I have never met a single case where it was necessary to convert a cluster to transparent.
    If you try to select on specific values of a non-transparent field in a cluster without also specifying selections for the primary key, then the database will have to do a serial read of the whole physical cluster (and the ABAP DB interface will have to decompress every single record to extract the fields). The performance of that is monstrous -- maybe that was the reason of your question. However, the solution then is (in the case of BSEG) to query via one of the index tables (where you are free to create secondary indexes since those tables are transparent).

  • Creation of secondary indexes due to heavy flow of messages in ecc smq2

    Hi gurus,
    So we are facing smq2 issues from last 15 days in Ecc system due to some Time Limit Exceed and some times Object is Locked by the user xxxx
    So finally we decided to go for creating seconday indexes in Ecc side , So here my question is there any thing required from Pi side while creating
    Secondary indexes why i am asking this question is there is no issues From PI end after reaching to target(ECC) system only messages got stucking
    in smq2 and facing issues .Below is the interface details.
    ECC-FSCM
    SAP ECC 6.0
    FSCM
    CreditCommitment_In and CreditCommitment_Out
    CC_ProxySender_FSCM
    CC_ProxyReceiver_FSCM
    Plz reply back .
    Regards
    Madhu

    If you had gone through the replies in your previous post, Iñaki Vilaand myself already provided the report name which needs to be scheduled to clear the messages in queues.
    Plz provide the permanent fix for this issue

  • Regarding secondary index

    how and when we create secondary indexes and what are the advantages and disadvantages of secondary indexes?

    Hi
    Index: Technical key of a database table.
    Primary 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.
    Secondary index: Additional indexes could be created considering the most frequently accessed dimensions of the table.
    Structure of an Index
    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.)
    Accessing tables using Indexes
    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
    Regards

  • Creation of Secondary Index

    Hi...
    Scenario:
    I have loaded BX and BF as per practice. However, i am not getting current stock values for materials which had 0 opening stock when BX was pulled (I did not select checkbox 'Zero stock to be transferred'). Note 823951 suggests executing program 'SAP_REFPOINT_COMPLETE' in such scenario.
    Probelm:
    The note suggests creating an index on all dimensions except time. However, the E table for 0IC_C03 is in local package both on development and production system. Hence, am unable to create and transport the index. How do we create secondary index on InfoCube?
    Also, when the program is executed in check mode (without creating the suggested index) it ran for almost 7 hrs without any result. Does this program take huge time to complete even in check mode?
    Thanks & Regards,
    Anoop Sahu

    Hi,
    You can create index from Data Dictionary also.
    Goto se11-> choose table radio button -> give your table name -> click on change
    this will shows the table fields screen.
    In that screen select Create Index button -> Choose the required field.
    Every table should maintain a primary index when table was created based on the primary key of that table. if we create new index then it is called secondary index.
    usng above procedure u can create secondary index. Just try
    Regards,
    BRS

Maybe you are looking for

  • Strange email address associated with my apple id?

    A few months ago I got an iphone5c to replace my iphone 4. I hadnt bought credit for itunes until a few days ago. This morning I tried to purchase an album but it said because this was my first time buying anything from the device I needed to prove I

  • Kde and Pam related problems[solved]

    And here they are, from /var/log/errors: Jun 28 14:47:58 DreaM kdm: :0[2780]: PAM unable to dlopen(/lib/security/pam_console.so) Jun 28 14:47:58 DreaM kdm: :0[2780]: PAM [dlerror: /lib/security/pam_console.so: cannot open shared object file: No such

  • Uploaded image files not displayed correctly

    Hello everyone, I used the following article(on o'reilly) as reference for file upload: http://www.onjava.com/pub/a/onjava/2001/04/05/upload.html?page=1 While it works fine for most files types, there are problems with image files.(I am using PrintSt

  • Unable to open movies in certain sites using Firefox 4, no problem with former versions

    As a almost daily visitor of the site Bigfun.be I got a crash every time I wanted to open a movie, since I started using Firefox 4. After some automatic updates, the crashes disappeared. But it's still unable to open movie files. There is a message w

  • How to reserve stock for particular customer?

    HI all, How to reserve stock for particular customer when they has approved a particular batch? Please tell me all the possibles. Thank you. Richard