Impact of seconday indexes

Hi,
I want to create a few secondary indexes for my table.
But I could able to know that it's not good interms of performance. So Could anyone explain how the permance will be effected actually in detail and what's the alternative for my problem.
Thanks
G Kumari.
Moderator message - Please search before asking - post locked
Edited by: Rob Burbank on May 20, 2009 10:44 AM

Hi,
I want to create a few secondary indexes for my table.
But I could able to know that it's not good interms of performance. So Could anyone explain how the permance will be effected actually in detail and what's the alternative for my problem.
Thanks
G Kumari.
Moderator message - Please search before asking - post locked
Edited by: Rob Burbank on May 20, 2009 10:44 AM

Similar Messages

  • Maximum Number of Seconday index on ECC6.00

    Hi all,
         I tried created 22  seconday indexes for a table in ECC6.00  . This was just for testing purpose. Can anyone tell me the limit on number of seconday index on SAP table.
    I searched  forums before posting and found that 15 is the max limit.
    Best Regards
    Hari

    Hi ,
    There is no limit for the Secondary index, but we should be carefull not to repeat the fields ... Performnace optimizer will not identifies the correct index ...
    Reagrds,
    Bharani

  • Impact of Logging INDEX on Nologging object(TABLE) at the time of Recoveryt

    Hi All,
    If I have a TABLE which is of NOLOGGING Mode and the index on this table is of LOGGING Mode. If I want to Recover this table in case of its lost. How It will impact? Will it give any Error? Please Explain.....
    Thanks in Advance.

    You could always do this at the time of the backup to ensure no logging objects are recoverable from the backup at that point in time.......
    "alter database force logging "......... this enables the DBA to override no logging to ensure recoverability.

  • Impact of composite index

    Hi,
    I have created a composite index on two columns in a table. I would like to know whether there will be any negative impact of this. For example, will there be any problem while inserting data into table? Please advise.

    Sure - adding indexes on a table will have a negative impact on inserts, deletes and potentially updates, as now you have two (or more) things to update, rather than just the table.
    But you have to ask yourself, does the benefit of that index when retrieving data from the table outweigh the performance hit when you insert/update/delete? Usually the answer is yes, otherwise there would be no point in having the index in the first place.
    If you're asking whether having multiple columns in your index causes problems, then no, the impact is no higher than just a single column.

  • Slow Select Query - Where clause contains Seconday index field +other flds

    Hi friends,
    The below query is taking about an Hour to execute in production server when there are about 6 Million records in PLAF table. I have verified the trace in ST05 and the correct secondary index (Material Matnr + Plant Plwrk) is being selected.
    SELECT plnum
                 matnr
                 plwrk
                 pedtr
                 dispo
                 rsnum  FROM  plaf
                INTO TABLE it_orders
                WHERE ( ( matnr  IN r_mat1 )  OR
                                 matnr IN r_mat2  AND dispo IN s_mrp1 ) AND
                 pedtr IN s_date AND   
                 obart = '1'.
    Will it be a good idea to have only MATNR (secondary index field) in the where condition of the select query and delete the internal table entries for the other where conditions ?
    Edited by: Shruthi Seth on Feb 1, 2009 10:10 AM

    Hello.
    Creating a range r_mat = r_mat1 + r_mat2, I would do something like:
    READ TABLE s_mrp1 TRANSPORTING NO FIELDS INDEX 1.
    IF sy-subrc EQ 0.
      SELECT plnum matnr plwrk pedtr dispo rsnum
        FROM plaf
        INTO wa_orders
       WHERE matnr IN r_mat
         AND pedtr IN s_date
         AND obart = '1'.
        IF wa_orders-matnr IN r_mat2.
          CHECK wa_orders-dispo IN s_mrp1.
        ENDIF.
        APPEND wa_orders TO it_orders.
      ENDSELECT.
    ELSE.
      SELECT plnum matnr plwrk pedtr dispo rsnum
        FROM plaf
        INTO TABLE it_orders
       WHERE matnr IN r_mat1
         AND pedtr IN s_date
         AND obart = '1'.
    ENDIF.
    Regards,
    Valter Oliveira.

  • Negative performance impact of index

    A SELECT statement I've written references an otherwise unused VARCHAR2 column in a table that defaults to NULL, and which is set by another statement for some (not all) rows to a three-character string (like 'XYZ'). The query takes 2.5 hours to complete, but with an index added on the column, finishes in 2 to 3 minutes. I'm perfectly satisfied with this solution, but my extremely cautious colleagues (one in particular) are concerned that adding an index will negatively impact the performance of other INSERT or UPDATE statements that reference the table but not the column. I think they're being wildly overcautious, that an index on a column that can contain only 2 values will have minimal impact on other DML statements, if any. Am I right? Is there a reference I could consult to settle disputes like this?
    Any opinions would be gratefully accepted.

    djenkins99 wrote:
    Is there a way to measure the impact of an index on inserts and updates? I could generate an explain plan, but I don't know how to translate the results of the explain plan into actual time (seconds less or more it takes a statement to execute). Even with my select statement, the explain plans taken before and after adding the index are definitely different, and the explain plan with the index shows it being used, although the total cost of the query with or without the index is minimally different.The "cost" of INDEX maintenance is not available as separate metric as far as I know.
    It can be obtained indirectly.
    1) CREATE TABLE BENCH(ID NUMBER);
    2) INSERT INTO BENCH SELECT ID FROM MANY_ROWS_TABLE;
    measure how long INSERT takes
    SHUTDOWN IMMEDIATE
    STARTUP
    -- clears SGA of cached rows
    3) TRUNCATE TABLE BENCH;
    4) CREATE INDEX NDX_ID ON BENCH(ID);
    5) INSERT INTO BENCH SELECT ID FROM MANY_ROWS_TABLE;
    measure how long INSERT takes
    the duration difference is cost to maintain the INDEX

  • 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

  • Which index  I should create  Btree or Bitmap  index?

    I have table with columns c1,c2,c3
    I want to create index on column c1
    which index I should create Btree or Bitmap index
    the column contain 50% unique values and 50% duplicate values
    If Btree why?
    If Bitmap Why?
    I know that
    Btree is used when there more unique values (high cardinality)
    Bitmap is used when there less unique values (low cardinality)

    read this -
    Deadlocks with Bitmap Indexes
    Bitmap indexes were designed to be used solely within data warehouses, i.e. where the vast majority of the database activity is reading data,
    and there's very little (or no) data modification, except for batch processes which occasionally re-populate the warehouse.
    Each "row" in the bitmap index contains references to potentially many different rowids, in contrast to a B*-tree index which references a single rowid.
    It should be obvious, therefore, that, since the transactional mechanism is the same for all database operations, that any DML on a table which impacts the bitmap index may end up locking (or attempting to lock) many different "rows" within the index.
    This is the key concept with deadlocks in bitmap indexes, you're not being deadlocked on the underlying table, but on the index blocks. Courtesy - http://www.oratechinfo.co.uk/deadlocks.html
    hope u got it now...

  • Add an index to a DB table without modification?

    I have a database table in the SAP namespace, and I would like to add one or two indices to the table (non unique database index). This is not possible without modifying the table, right?

    Hi Daniel,
    No it wouldnt be a modification to the table but you should first analyze the impact of the index since its not advisable to create index always.
    refer the below link:-
    [Create index in standard table;
    [What to Keep in Mind for Secondary Indexes|http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm]
    Regards
    Abhii
    Edited by: Abhii on Sep 1, 2010 3:49 PM

  • Using Secondary Index

    Hi,
    I have a secondary index with 3 key fields.While wrting the select query with these 3 key fields I am providing 2 more non-key fields. Now the problem is that the secondary index in not used in this case. Can anybody help me why it is not using the secondary index.
    For example:
    Seconday Index fields are : fd1, fd2, fd3
    In select query:
    select A B C from  <XYZ> into table I_XYZ
    where  fd1 = 'a'     " key field
    and fd2 = 'b'         " key field
    and fd3 = 'c'         " key field
    and fd4 = 'd'         " non-key field
    and fd5 = 'e'.        " non-key field
    Problem : Query is not using the seconday index.
    Regards
    Sanjay

    hi,
    Check if your secondary index is having mandt field or not.
    system changes your select as
    select A B C from <XYZ> into table I_XYZ
    where <b>mandt = sy-mandt  and</b>
    fd1 = 'a' " key field
    and fd2 = 'b' " key field
    and fd3 = 'c' " key field
    and fd4 = 'd' " non-key field
    and fd5 = 'e'. " non-key field
    so, secondary index will be chosen only if mandt is there in the list of fields in secondary index.
    Regards
    sailaja.

  • Secondary Index with or without MANDT field

    HI ABAP Guru's,
    What is necessary to add field MANDT while creation of secodary index in DBS.
    But i some body my superiors challanged to me with out using MANDT our secoday index won't works.
    But i tested few scenarios i am not get differnce.
    please advice me exactly which scenarios it is mandatory.
    Below are the Time taken with deffrent scnarios i created one test program to get the time with secondary index with out secodary index secondary index with mndat fiels
    **&with out creation of seconday index
    *1st time -57,103,681
    2nd Time-55,388,294
    **before creation of seconday index with out mandt
    I1st time execution-324,119
    2nd time progrm execution--391,134
    3rd time progrm execution-327,046
    4th time progrm execution336,774
    5th time progrm execution359,100
    6t  time progrm execution-328,027
    *before creation of seconday index with mandtiI1st time execution-367,623
    2nd time progrm execution365,139
    3rd-352,328
    4th-369,122
    5th-352,236
    6th380,590
    7th466,810
    Thanks In Advance,
    Kandula.
    Edited by: Thomas Zloch on Nov 18, 2011 1:08 PM

    Vishnu Tallapragada wrote:
    So if you are maintaining multiple client data on the same database, then not adding MANDT to index will have undesirable effects as any select based on secondary index may return records that are not belonging to this client and deletes and additions on the index from multiple clients will lead to data integrity issues.
    Wrong!
    WHERE clause decides about data being selected, deleted or what-ever.
    Index decides only about HOW data is accessed (if used), not WHAT data is accessed.
    If your database returns a different result depending on the indexdefinition,
    you should log a call at your DB vendor immediately, because this is a bug.
    In general, as the client has usually only a small number of distinct values, it is not a good field,
    to convince the database, that this index is a good idea. But on high volume tables it can be very selective
    as far as the number of result records is concerned (might cut down 50% when 2 clients!).
    In addition it is a very short field, so it should not cost much storage (esp. when compressable).
    Szenario:
    MANDT+IDX-Field with two clients and lets say 5000 record per client (so that idx access will be interesting),
    assuming a given IDX value will return 50 records (25 in each client).
    So the select will be
    ... WHERE MANDT=sy-mandt AND IDX=value
    Accesing the index with only IDX will result in stepping down the index-tree (say 3 blocks) and then reading leafblocks
    to get the 50 hits for IDX-value (assuming 30 records per leafblock -> 2 leafblocks required to gret the 50 records)
    Right now you have accessed 5 blocks to get the address of 50 records that still need to be checked against MANDT.
    So there is need to get 50 blocks (may be less, depending on clustering) to do a filter on MANDT
    and get the final 25 records for the result.
    If you put the MANDT field into the index it might require more space, so that we assume 20 records per leaf block now.
    But since you can now filter MANDT already on the index blocks, you will again only need to get 5 blocks and
    have the adress of the required 25 target records.
    So getting the result is 55 blockinspections without MANDT in index and 30 blockinspections with MANDT in index in this case.
    Now you can start pushing around values and statistics an calculate at what amount of data and average
    size of resultsets it becomes right or wrong to include MANDT. It may turn out both ways, allthough I think
    with MANDT being small, it is usually loss of brain cycles to calculate around for this.
    You simply include it, it will cost only little space and it will never be wrong.
    You leave it out, you will gain little space, but might end up with performance loss.
    If you have only one client in the system, you can safely go with the saving space strategie, as long as you do not need
    a UNIQUE secondary index.
    Volker

  • Secondary Index for the table MSEG

    Hi folks,
             One of my report is comparetively very slow when it is executed in the production server. when i chked, a query related to the MSEG table is taking more time to execute. I want to create a secondary index for that table. Could any body tell  me the procedure of creating the seconday index for the table MSEG, as i am not aware of that.
    Thanks in advance,
    Shyam.

    Dear shyam,
    Search SDN before posting any thread their are 10k threads available for your question anyhow for your reference here is one link
    http://help.sap.com/search/highlightContent.jsp
    Cheers
    fareed

  • Function Based Indexes - negative performance

    Has anyone run across any cases where they have had issues with Function Based Indexes negatively impacting performance??
    We are trying to use function based indexes in 9i (NLS_SORT=GENERIC_BASELETTER) and 10g (NLS_SORT=BINARY_CI) for case insensitivity.
    We thought this was a decent solution until recently when testing with larger datasets. Any info is appreciated.
    Thanks,

    Just to clarify rreynoldson's first point:
    All indexes will negatively impact inserts. Indexes, including function-based indexes, may or may not improve update and delete performance depending on whether the overhead of maintaining the index outweighs the benefit of being able to use the index to find the row(s) to update relatively quickly.
    For user564260:
    Assuming those parameters are set, make sure that you've gathered statistics on the function based index. If that doesn't resolve the problem, can you post a small test case that demonstrates the problem where you
    - Create the table
    - Create the indexes
    - Populate it with data
    - Run the query that you'd expect to use the FBI
    - Post the explain plan
    that would help us immensely.
    Justin

  • Need info related to creating indexes on ODS.

    Hi All,
    I have transported manually created secondary indexes on my ODS to quality system.
    Now I have a requirement where i have to optimise the query performance.
    In quality, I activated the ODS.There was data in the ODS before creating of index.
    But still my Query is taking too long to display records.
    Now my main doubt is since I have transported the manually created indexes,
    when these indexes will start working whether at the time of data loading or after the activation of ODS?
    Please advice on how i can optimise the query performance.

    Hi Priyanka,
    I think, your indexes should be working immediately after the transport.
    You can always create indexes even when there is preexisting data. As soon as you save the indexs they should be created on the data base.
    You can check whether your indexes are being used by your query in RSRT in display run schedule in data manager in execute and debug mode (Check the execution plan).
    You can check whether your indexes have been created in ODS Active table in SE11 in index maintainance and also in DB02 , I believe.
    To optimize your query performance - Filter in the queries should be on the primary indexes or the seconday indexes. You will get to know whether the indexes are bein guse and the cost saving by the usage of these indexes in the execution plan.Try to create indexes only when absolutely essential , because as mentioned in the post below, it affect loading performance, since it has to create these indexes for the newly loaded data
    If you are using Oracle data base you can consider partitioning your infoprovider
    If you are using DB2 - You can try multi dimensional clustering
    You can choose appropriate read mode and Cache mode for the query
    You can archive historic data no longer reported, to increase the reporting speed
    You can design the query correctly - with correct placement of filters
    Points to note when creating secondary indices is the order and the number of characteristics  in the secondary indices is also the determining factor for the usage of the index by your query
    Hope this helps,
    Best regards,
    Sunmit.

  • When To Create an Index

    Hi,
    First pardon my generic question, but I am posting this after much frustration. When you create an index on a table, which thought process you follow? I mean instead of blindly throwing index on every column in where clause, how do you decide as whether to create index or not, type of index, composite index or not etc. Please do the favor and describe in simple words.
    Thanks a million.

    EdStevens wrote:
    Antonio Navarro wrote:
    Usually, a index is better where it return the same data more faster than a full scan
    HTH"All else being equal"
    But all else is never equal.
    don't forget that every index you create causes additional overhead for every insert/update/delete statement on that table. So among other considerations you need to balance the negative impact of the index on DML statements vs. the sometimes positive impact on queries.Which means the only simple answer to the generic question on when to create an index is that there are no simple answers: http://jonathanlewis.wordpress.com/2010/05/11/philosophy-10/
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    A general reminder about "Forum Etiquette / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718
    If you never mark your questions as answered people will eventually decide that it's not worth trying to answer you because they will never know whether or not their answer has been of any use, or whether you even bothered to read it.
    It is also important to mark answers that you thought helpful - again it lets other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching the same question, moreover it means that when you mark a bad or wrong answer as helpful someone may be prompted to tell you (and the rest of the forum) what's so bad or wrong about the answer you found helpful.

Maybe you are looking for