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

Similar Messages

  • 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 an index for a list of itmes in a single object?

    Can we create an index for multiple values in a single object. We have an object Order that contains list of items. I like to get all orders for a specific item. I want to create an index to speed up the query. Is it possible? What are the other alternatives?
    My Order object is as follows:
    Orders
    Item List
    Shipping Address
    Example:
    Order 1
    i1, i2, i3, i4
    123 some way, city, 12345
    Order 2
    i2, i3
    333 some other way, city2, 33333
    order 3
    i2, i4, i7
    My search would be, give me all orders that has item i2. It should return Order 1, Order 2 and Order 3.
    Thanks

    Hi,
    I think that this will work ...
    ValueExtractor extractor= new ReflectionExtractor("getItemList");
    cache.addIndex(extractor, true, null);
    Set setKeys = cache.keySet(new EqualsFilter(extractor, i2));
    In this case, the Collection value extracted by the ValueExtractor is treated as a Collection of contained attributes when the index is created.

  • How can I create index(uniqie index) for a existed table?

    Hi guys,
    I want to create a index for a existed table, it should be unique index. I did it using se11, "indexes," and select the radio button "unqiue index", of course the fields as well. But when I activate it, I get a waring and therefore can not create this index. But if I select radio button "non-uniqe index", it works.
    However I have to reate a unqiue index.
    How can I do it?
    Thanks in advance
    Regards,
    Liying

    HI Wang
    You can create your index via SE11, enter the table name, click change, choose Go To, Indexes. Here create your index with the key fields that you want. To use the index, your select statement WHERE clause, you must have the key fields of the index in the order that they appear in the index. The "optimizer" will choose the index depending on your fields of the WHERE clause.
    One thing to remember is that when you create indexes for tables, the update or insert of these tables may have a slower response then before, I for one have never seen a big problem as of yet.
    this Document may help u on primary and secondary indexes :
    http://jdc.joy.com/helpdata/EN/cf/21eb20446011d189700000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb47446011d189700000e8322d00/content.htm
    If it helps Reward the points
    Regards,
    Rk
    Message was edited by:
            Rk Pasupuleti

  • Creating index for standard SAP tables

    Hi!
    What are the advantages and disadvantages of creating addtional indexes for tables with massive amount of data (BSEG, BKPF, COEP, etc...).
    If I create a new index it supposed to make the table access faster, for the cost of hard disk space.
    Am I right?
    Thank you
    Tamá

    Hi,
    Primary and secondary indexes
    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
    Thanks and Regards
    Arun Joseph

  • 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

  • Can you create an index on a Map?

    I have a few questions that I can't seem to figure out nor find a viable example for. Can you create an index for a Map contained within a nested object, and if so, how would you do this? I currently have a Filter the inspects this criteria in the cache but am unable to figure out to create a usabe index for the custom filter. I'm using Coherence 3.5.2 - any help would be most appreciated. I'm not sure if/what I need to do with the SimpleMapIndex....
    Here's the basic object map below. My filter is retrieving all of the CustomerGroup objects that have a Customer in it's collection that contains the passed in Integer value in the Customer's Map. So can you create an Index on a Map (and a nested one at that) and how do you that? The index would need to be on the nested customerValues hashmap.
    class CustomerGroup
        Set<Customer> customers ;
    class Customer
        Map<Integer, CustumerValue> customerValues;
    }

    If you write a custom ValueExtractor, which you need to create an index, then you will not need a custom Filter.
    Depending on how efficient you need to be you custom extractor can use POF and not have to deserialize the entries to create the index, or it can deserialize the class, which will make the code more straight forward.
    For example, without using POF
    public class MapKeyExtractor extends EntryExtractor implements PortableObject {
        public MapKeyExtractor() {
        @Override
        public Object extractFromEntry(Map.Entry entry) {
            Set<Integer> keys = new HashSet<Integer>();
            CustomerGroup group = (CustomerGroup) entry.getValue();
            Set<Customer> customers = group.getCustomers();
            for (Customer customer : customers) {
                keys.addAll(customer.getCustomerValues().keySet());
            return keys;
        @Override
        public boolean equals(Object obj) {
            return (obj instanceof MapKeyExtractor);
        @Override
        public int hashCode() {
            return MapKeyExtractor.class.hashCode();
        @Override
        public void readExternal(PofReader in) throws IOException {
            super.readExternal(in);
        @Override
        public void writeExternal(PofWriter out) throws IOException {
            super.writeExternal(out);
    }The extractor above will return a collection of all of the Integer values in the keys of all the customerValues of all the customers in a CustomerGroup (I have guessed you might have accessor methods on the classes you posted).
    You can then use a ContainsFilter for your query. For example to get all the values from the cache where the customerValues map contains a 19 in the key...
    Set results = cache.entrySet(new ContainsFilter(new MapKeyExtractor(), 19));You could write a version of the MapKeyExtractor that uses POF and would not deserialize the values but this would be more complicated code as it would need to extract the Map from the POF stream of the value and walk down the keys and values extracting the keys. It is doable but not worth it unless you are really worried about performance of index updates.
    Discalimer I have written the code above from the top of my head so have not compiled it or tested it but it should be OK.
    JK

  • Creating an INDEX on an internal table

    Hi Folks,
    Currently I am dealing with some programs which needs to be optimised.I had came acrossed some queries which are having some fields in the where clause which are neither a primary  key nor in any index.As it is not advisable to create as many index as we can in a standard table,I just want to create an index on the internal table.
    Will be glad if anyone here can provide me some lead in this.
    Thanks,
    K.Kiran.

    Hi,
    There is no need to create the index in the internal table since the primary key of the database table from which you selected the data becomes Primary index for the internal table.
    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
    You can also create further indexes on a table in the ABAP Dictionary. These are called secondary indexes. This is necessary if the table is frequently accessed in a way that does not take advantage of the sorting of the primary index for the access.
    You create secondary indexes using the ABAP Dictionary. There you can create its columns and define it as UNIQUE. However, you should not create secondary indexes to cover all possible combinations of fields.
    Only create one if you select data by fields that are not contained in another index, and the performance is very poor. Furthermore, you should only create secondary indexes for database tables from which you mainly read, since indexes have to be updated each time the database table is changed. As a rule, secondary indexes should not contain more than four fields, and you should not have more than five indexes for a single database table.
    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.
    Regards,
    Priyanka.

  • 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

  • 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

  • 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

  • Create DB Index for DSO

    Hi Experts,
    How we can create DB index (Secondary Index) for a DSO.
    Thanks,
    Satya

    Hi Satya,
    Just goto change mode of the data target and do the task as mentioned by Mr.Vito Savalli
    But before doing the above task, request you to kindly check which infoobjects are most suitable for the creation of secondary Indexes.
    you can do this activity in RSRV Checks
    With Regards
    Arun

  • Error while creating an index for NVARCHAR2 datatype

    Dear All,
    I'm trying to create and index on a NVARCHAR2 field type but I get the following error:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-10509: invalid text column: SUBJECT
    ORA-06512: at "CTXSYS.DRUE", line 157
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 176
    If I create an index in the same table but for a VARCHAR2 field type, I don't get any.
    Please help me. Here is the table description:
    Thanks.

    Daniele,
    Can you describe your use of NVARCHAR2 ?
    What is your National character set ?
    What kind of data are you storing there ?
    - Steve B.

  • Creation of secondary indexes for table "RSBATCHCTRL_PAR" failed

    Hi ,
    We have installed EHP1 on our BI7.0 system successfully, later we are trying to apply SPS01 for this EHP but we got the follwoing error during TBATG conversion.
    2 EGT092 Conversion of table "RSBATCHCTRL_PAR" was restarted
    2 EGT241 The conversion is continued at step "6"
    2 EGT246 Type of conversion: "T" -> "T"
    2 EGT240XBegin step "RSBATCHCTRL_PAR-STEP6":
    4 EGT281 sql:
    4 ED0314 CREATE
    4 ED0314 INDEX [RSBATCHCTRL_PAR~DB] ON [RSBATCHCTRL_PAR]
    4 ED0314 ( [JOBNAME] ,
    4 ED0314 [JOBCOUNT] ,
    4 ED0314 [SERVER] ,
    4 ED0314 [HOST] ,
    4 ED0314 [WP_NO] ,
    4 ED0314 [WP_PID] ,
    4 ED0314 [PROCESS_TYPE] )
    4 ED0314 WITH ( ONLINE=OFF )
    4 ED0314 ON [PRIMARY]
    2 ED0314 Line 1: Incorrect syntax near '('.
    3 EDA093 "DDL time(___1):" ".........6" milliseconds
    2EEGT236 The SQL statement was not executed
    2EEDI006 Index " " could not be created completely in the database
    2EEGT221 Creation of secondary indexes for table "RSBATCHCTRL_PAR" failed
    2EEGT239 Error in step "RSBATCHCTRL_PAR-STEP6"
    2 EGT253XTotal time for table "RSBATCHCTRL_PAR": "000:00:00"
    2EEGT094 Conversion could not be restarted
    2 EGT067 Request for "RSBATCHCTRL_PAR" could not be executed
    1 ED0327XProcess..................: "ferrari_12"
    1 ED0302X=========================================================================
    1 ED0314 DD: Execution of Database Operations
    1 ED0302 =========================================================================
    1 ED0327 Process..................: "ferrari_12"
    1 ED0319 Return code..............: "0"
    1 ED0314 Phase 001................: < 1 sec. (Preprocessing of TBATG)
    1 ED0314 Phase 002................: < 1 sec. (Partitioning)
    1 ED0309 Program runtime..........: "< 1 sec."
    1 ED0305 Date, time...............: "03.06.2009", "12:47:21"
    1 ED0318 Program end==============================================================
    1 ETP166 CONVERSION OF DD OBJECTS (TBATG)
    1 ETP110 end date and time   : "20090603124721"
    1 ETP111 exit code           : "8"
    1 ETP199 ######################################
    System properties:
    SAP - BI7.0 with EHP1
    Database - MSSQL 2000
    OS - Windows2003
    Please suggest.
    Thanks in advance,
    Pavan.

    > We have installed EHP1 on our BI7.0 system successfully, later we are trying to apply SPS01 for this EHP but we got the follwoing error during TBATG conversion.
    > 2 ED0314 Line 1: Incorrect syntax near '('.
    > 3 EDA093 "DDL time(___1):" ".........6" milliseconds
    > 2EEGT236 The SQL statement was not executed
    This is a known problem with SQL Server 2000, see
    Note 1180553 - Syntax error 170 during index creation on SQL 2000
    I highly suggest upgrading to SQL Server 2005 or 2008.
    Markus

Maybe you are looking for

  • "Illegal UTF8 string in constant pool"

    I'm running a jsp application on JRun 3.1 with an Appache web server. Every once in while I get this error when trying to access a jsp. "Illegal UTF8 string in constant pool". If I hit refresh or reload the page loads fine. It appears to be random an

  • Script ideas?

    Hello,      I have a call center script for a Help Desk that checks to see if any agents are logged in.  If none are logged in, calls are redirected to a cell phone.  The only problem I have is that the agents forget to logout and (they only close th

  • Cellular Data not enabling on iPhone4S...

    Hi There, Cellular Data not enabling on iPhone4S. What could be the issue. Software Version :- 8.1.2(12B440) Thanks, Nagaraj M

  • Is Adobe PDF conversion into xlsx files a flop?

    Can anyone help me with this real phenomen? I have converted a PDF file into xlsx. To my surprise, the european decimal "coma" was displaced by one caracter to the left as a thousand (point), this in numbers of up five caraters including two decimals

  • Black Screens On Start Up - HELP!

    Hi All, On startup, I am first getting a question mark in the folder (old OS 9), then after thinking for a bit, I get the grey screen and apple as expected, then the screen goes black (unexpected), then I get the blue screen with the normal rectangle