Skip to Content
avatar image
Former Member

Secondary Index + client field

I posted this already as an answer to another thema but since it is very important to me (and since there were some mistakes in my answer) now I make a new theme out of it:

When I look at non-unique secondary indizes in the data dictionary (Release 4.6c) I find that around two of three non-unique secondary Indizes of the standard SAP tables (I looked up by checking the tables dd03l, dd12l and dd17s) have the client field (rollname = mandt) as an entry, one third don't have the client field at all.

I wonder what could be the arguments using the client field in a secondary index or not.

Since we have performance problems in using huge data tables it would be very important for me to know if the usage of the client field as an index field brings more advantages or more disadvantages. We don't have any transactions where the "client specified" clause has to be used.

Kind regards Axel Kiltz

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Feb 05, 2004 at 12:50 PM

    I can't quite determine if you know what the client field is. Do you know what it's used for?

    The only time you'd specify the client is if there's a need to access data in another client within the same database otherwise the client is always assumed to be the user's currently logged-on client anyway.

    Maybe this will help a bit.

    Excerpt from --> http://help.sap.com/sapdocu/core/47x200/HELPDATA/EN/83/08443c4a089537e10000000a114084/frameset.htm

    Viewed technically, each time a client-specific table is accessed, the database interface implies an additional selection of the active logon client, meaning that the WHERE clause is added to the SQL statement.

    "WHERE <client-field> = <login-client>".

    This substitution is made dynamically in the database interface at runtime.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I understand and agree with your logic but disagree with putting the client last.

      The answer is really to either put the client in as the first index field, or to leave it out altogether. The choice made will be specific to the needs of each installation and is dependent on the number of "real" clients in a system. Undoubtedly the client field will not be necessary in most production systems, where there is only one "real" client (excluding clients like 000 and 066).

      However, this must be considered against the impact to other systems (such as QA and Training) where there may be multiple clients as here the client field would be most useful as the first field of the index.

      It would be nice if we could define the index as including the client field for certain systems only...

      Cheers,

      Scott

      Message was edited by: Scott Barden

  • avatar image
    Former Member
    Mar 18, 2004 at 04:50 AM

    If you have single client no need to specify client field in the index .

    Add comment
    10|10000 characters needed characters exceeded