Perfomance of select

Hi , here i am using inner join for 3 data base tables in below code ,
SELECT crco~objid     "Object ID
         crco~endda     "End date
         crco~begda     "Start date
         cssl~lstar     "Activity type
         cost~tkg001    "Activity Unit price month01
         cost~tkg002    "Activity Unit price month02
         cost~tkg003    "Activity Unit price month03
         cost~tkg004    "Activity Unit price month04
         cost~tkg005    "Activity Unit price month05
         cost~tkg006    "Activity Unit price month06
         cost~tkg007    "Activity Unit price month07
         cost~tkg008    "Activity Unit price month08
         cost~tkg009    "Activity Unit price month09
         cost~tkg010    "Activity Unit price month10
         cost~tkg011    "Activity Unit price month11
         cost~tkg012    "Activity Unit price month12
    INTO TABLE i_actp
    FROM crco INNER JOIN cssl
      ON crcokostl     EQ  csslkostl
   INNER JOIN cost
      ON csslobjnr     EQ  costobjnr
   WHERE crco~objty EQ c_a.
but for this i am getting some lakhs of records so how can i implement FOR ALL ENTRIES for tis select statement ,
thx for u r help

FOR ALL ENTRIES clause is meant to be used when there are records in an existing internal table which you want to use for filtering out the data while selecting from a database table using a select.
you can probably first fetch data from the COST and CSSL tables and use for all entries.
assuming you have data in itab_cssl and itab_cost tables first (the cost table will be populated based on the cssl table for matching objnr...so you can use for all entries there too.
select <your field list> from cssl into table itab_cssl.
if itab_cssl[] is not initial.
select <your field list> from cost into table itab_cost for all entries in itab_cssl where objnr = itab_cssl-objnr.
endif.
if itab_cssl[] is not initial.
select <your field list> from crco into table i_actp for all entries in itab_cssl where kostl = itab_cssl-kostl and objty eq c_a.
endif.
thereafter you can remove the records which are not matching the criteria.
For your example, it depends what you want. If the table holds lakhs of records for the criteria you have specified, it will indeed return those records. If you want to filter the records then use more fields in the WHERE clause of the select query.
The ideal scenario will be to get the data by specifying all fields that are part of the primary key of the table in the where clause in an internal table and then delete the records that you don't require. (Of course, if this suits your scenario). This way it will use the primary index on the table and the performance will improve.
hope that helps....

Similar Messages

  • Regarding the perfomance of a join .

    Hi,
    I have a join with tables MARD,MVKE,MAKT,MARA .
    Is it a bad habit to join more than 3 tables , is it inversely affect the perfomance.
      SELECT dmatnr AS material dwerks AS plant dlgort AS slocation dumlme dlabst rmeins  k~maktx AS descr
                          INTO CORRESPONDING FIELDS OF TABLE        it_data2 FROM mard AS d INNER JOIN mvke AS m
                          ON dmatnr = mmatnr
                          INNER JOIN mara AS r
                          ON rmatnr = dmatnr
                          INNER JOIN makt AS k
                          ON kmatnr = dmatnr
                          WHERE
                          d~matnr IN r_matnr
                          AND d~werks IN r_plant
                          AND m~vkorg IN r_sales.
    Thanks & Regards,
    Ratheesh BS

    I have tried to re-arrange your join statement. Let me know if this helps. It all really depends on which of your ranges / select-options you intend to make mandatory. You need to make some of your range / select-options mandatory.
    SELECT d~matnr AS material
           d~werks AS plant
           d~lgort AS slocation
           d~umlme
           d~labst
           r~meins
           k~maktx AS descr
    INTO CORRESPONDING FIELDS OF TABLE it_data2
    FROM       mara AS r
    INNER JOIN makt AS k ON r~matnr = k~matnr
    INNER JOIN mvke AS m ON m~matnr = r~matnr
    INNER JOIN mard AS d ON d~matnr = r~matnr
    WHERE r~matnr IN r_matnr
    AND   d~werks IN r_plant
    AND   m~vkorg IN r_sales
    AND   k~spras EQ sy-langu.

  • DB Link from Oracle to SQL Server error

    Dear buddies,
    I need to perfome some select on the tables which reside in SQL Server 2005 from Oracle 10g.
    I followed the steps given in :
    http://www.dba-oracle.com/t_heterogeneous_database_connections_sql_server.htm
    I could perform a TNS ping which is successful but only when I perform a select I receive this error.
    ERROR at line 1:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from SQLS
    I have checked that my dsn name is in small caps all the way wherever it is used(Since its suggested in many sites).
    Please guide me.
    I am really looking ahead for a solution.
    Regards,
    Nith

    use the like to setup ODBC and datasource
    http://www.databasejournal.com/features/oracle/article.php/3442661/Making-a-Connection-from-Oracle-to-SQL-Server.htm
    and then create link server in sql server after you test connenction with oracle

  • CMP Entity Beans read database row twice?

    Here are two basic questions regarding container managed persistence Entity Beans:
    How many database read operations are performed when a remote reference to a CMP Entity Bean is obtained by a client?
    Is it correct, that each row is read twice?
    For example if a have one row in a database which I want to lookup, AFAIK first the findByPrimaryKey method perfoms a select to lookup the primary key, and then the (container-)ejbLoad method actually reads the row a second time to populate the CMP fields of the bean.
    And how often are UPDATE statements performed?
    Is a database UPDATE statement performed each time a setXX method is invoked?
    Thanks for any help,
    Robert

    How many database read operations are performed when a
    remote reference to a CMP Entity Bean is obtained by a
    client?
    Is it correct, that each row is read twice?It all depends on the CMP system. A simple system might well hit the database twice, once to validate the primary key and once to load the object's fields. A
    smarter system might try to cache the results from the first, so it didn't need to do the second (although this might be a bit dodgy from a transactional point of view).
    However, a couple of facts about databases come in here. Firstly, the query to check the primary key doesn't actually need to load any data from the table: it just needs to check that the key exists. Thus, it should be possible to handle this query just using the index, not touching the table itself at all. Secondly, databases do their own caching, so if a row was loaded in the first query, there is a good chance that it would still be around for the second.
    And how often are UPDATE statements performed?
    Is a database UPDATE statement performed each time a
    setXX method is invoked?Under CMP 1.1, UPDATES are typically done at the end of a transaction; if you use container-demarcated transactions, then yes, UPDATES will happen after every call. If the client code sets up its own transaction, then the UPDATE will only happen after several setXXX calls.
    This can be a performance problem. A common solution is the use of coarse-grained detail objects:
    http://java.sun.com/j2ee/blueprints/sample_application/model/ (section 10.4.1.2)

  • SELECT FROM AUSP perfomance improvement

    Hi!
    Generally speaking our problem is long runtimes for transactions dealing with configuration (CU50, VA01/VA02/VA03).
    ABAP runtime analysis (SE30) and performance trace analysis (ST05) clearly show that 85% percents of total execution time is spent on single SELECT statement of standard FM (CLSE_SELECT_AUSP), which is called many thousands of times:
              select * from ausp appending table x_ausp
                                 for all entries in ix_objek
                     where objek  eq ix_objek-low
                     and   mafid  in ix1_mafid
                     and   klart  eq klart
                     and   atwrt  in x_wertc
                     and   atflv  in x_wertn
                     and   atcod  in ix1_atcod
                     and   datuv  <= key_date.
    In spite of database specific request always looks like:
    SELECT * FROM AUSP
    WHERE MANDT = :A0
    AND "OBJEK" = :A1
    AND "MAFID" = :A2
    AND "KLART" = :A3
    AND "DATUV" <= :A4
    and access is done based on index AUSP~N3 range scan we have an unacceptable runtimes.
    Can anybody suggest any perfomance tuning? We tried to create custom index based only on fileds from previous select, but improvment is too small. Is it possible to activate some type of table buffering for AUSP? Any help appreciated.
    Regards,
    Maxim.

    Hello Maxim,
    Are the database statistics up to date for this table ?
    You can do this using program RSANAORA (if you have an oracle database). This should ensure you the right index is chosen. You might want to check with your BC people first, as this is normally their job.
    kind regards
    Pieter

  • Perfomance on column select

    Hello
    May be basic question but not sure,
    I have table with 20 column,
    In plsql i an using in for loop.
    1. for x in (select * from tab) -- all 20 column
    2. for x in (select col1,col2,col3...col10 from tab) ---10 column out of 20
    Which one ine better or both are same as far as perfomance is concern,
    Can any one please explaim ne.
    Thank you

    The first one is fetching more bytes from the database as the second one, so the second one will be slightly faster.
    Generally, doing a "select * from tab" inside code is sloppy programming most of the time. I can only imagine needing all columns, when copying entire records for some journalling actions. If you did not need all columns, you have achieved this:
    - you have less chance of using an index
    - you retrieve more bytes than necessary as said
    - imagine what the code will do when the table is expanded with extra columns in the future and the code gets recompiled ...
    - ... (I'm certain other people will know more disadvantages of using "select *" in code)
    So my advice is to always use scenario 2.
    Regards,
    Rob.

  • When I try and Save for Web in Photoshop CC I receive an error message saying 'The operation cannot be completed. The requested operation cannot be perfomed on a file with a user-mapped selection open'.

    When I try and Save for Web in Photoshop CC I receive an error message saying 'The operation cannot be completed. The requested operation cannot be performed on a file with a user-mapped selection open'. This happens with any of my files not just one in particular...
    Can anyone help solve this please?

    ELEMENTS 12 AND ELEMENTS 13
    Upgraded to 13 Thinking might resolve the issue.
    Was working fine up until we had "Tech" come in the office and "up grade some stuff"
    then all of a sudden i started getting this message, something happened but i don't have a clue what.

  • Very strange problem. Result = Cannot select HD to perfom install.

    Apologies for length, but this requires a LOT of explaining to be thorough.
    Problems began with attempting installation of 10.6.5 software update. Installation failed and all subsequent attempts failed. Attempted to update Safari and failed. Result was Safari would not open. Attempts to repair permissions with disk utility failed. Permission repair would error and stop. Did some digging online and read possible problem with BSD.pkg? I found this file, It showed zero kb in size. Decided to do a reinstall of Snow Leopard from my backup SL copy (keep the retail copy stored away). This is where 2nd set of problems begin...
    Attempting to do a reinstall over top of the current system failed. Error, installation failed. Decided to try retail copy in case the backup was bad. Same failure. Backed up my system on external and decided to reformat, erase, re-partition, and start anew, which I did erasing both the Mac partition and small Windows partition. Set up the resulting single Volume as the basic default setting named "Untitled".
    With the retail SL disc in the iMac, I went through the installation wizard as directed to install on the new "Untitled" Volume. The installation failed with "Error: could not copy necessary support files." I now presumed the disc to be stuck in the drive since I could only boot into the installer. I learned to hold the mouse button down on start up to get it out. (At this point, the iMac is booted into the installer with no disc in the slot)
    Decided to try a restore from disc image. Made a .dmg of the retail SL on a MacBook. Put the image on my external and connected to my iMac. Scanned the image ahead of time from the drop down menu as online guides indicate. Selected the image from the external as the SOURCE and the "Untitled" volume as the DESTINATION. Began restore. Here's where it gets really messed up...
    The restore from the disc image failed. I cannot remember the error "Could not allocate...?" erased and reformatted again because I really wasn't sure what to try. Upon restart, the computer boots into the installer (No disc in) and the "Untitled" Volume has somehow been renamed "Mac OS X Install Disc" and all options for the volume are grayed out! Can't erase, partition, or do anything to the Volume. Put SL disc in to run installer, but when prompted to select destination, only my external HD will show up.
    Booted into Tech Tool Pro 5 disc. The Volume Structures test fails of course. Specifically: "Validation Error Encountered Precheck Structures"
    My last idea was to try a target install using the MacBook.
    Help and guidance greatly needed and appreciated! I hope I can save it...

    I was only able to get part way through your post however from what I can tell you may have lost the internal HD. So here is what I'd try to do:
    Using the Original OS X install disc that came with the computer OR the retail Snow Leopard upgrade disc restart the computer while holding down the Option key. If this works it will give prompt you to start from the disc installed in the Superdrive. Choose that disc, it may take a few minutes to boot, then choose the language. At that point choose Utilities-Disk Utility and select the internal HD on the left then the First Aide tab and choose Repair Disk, you may have to run this a few times if it finds errors. If it continues to find errors after 3-4x then it's probably best to replace the internal HD. If the system can't find the internal HD to begin with then you know it's gone already.
    If the disk does repair at this point then I'd recommend doing a Erase and Install of 10.6.
    Let us know what happens.
    Roger

  • How to create a report  based on selected item from Select list?

    Hi,
    I have created a tables_LOV based on:
    select table_name d, table_name r from user_tab_cols
    where column_name like '%_type%'
    Then I created a page item ListOfTables,  Display as select list and pointing to tables_LOV.
    I run the page, and i can select the table i want from the drop down list.
    How to create a report  based on the selected item? (ex: select * from selected_table)
    many thanks in advance
    Salah

    Hi Salah,
    Allright, have a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
    I think that simulates what you're trying to accomplish. I've set up the simplest method I could think of.
    The report is based on an apex collection. If you are not familiar with that, you should study the documentation: APEX_COLLECTION
    To recreate my example you should:
    1) create an (interactive) report on your collection
    SELECT *
       FROM APEX_collections
    WHERE collection_name = 'MY_COLLECTION'
    2) create a page_item select list for the tables you want to display (in my case this is called "P38_TABLES" )
    3) create a dynamic action that triggers on change of your select list page_item. The dynamic action must be a PL/SQL procedure perfoming the following code:
    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
    end;
    Make sure you add your page_item to the "Page Items to Submit" section.
    4) Add an extra true action that does a refresh of the report region.
    Here are two pictures describing the da:
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA1.png
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA2.png
    Good luck and regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • Using functions in select statement(joining 5 tables) taking long time in Oracle

    Hi,
    I have created a query in oracle which joins 5 tables and uses two functions(function names are 'ca_concat' and 'ca_concat_noseq').
    Query takes approximately 40 secs to execute around 12000 records. If I remove the functions from query it excutes within a second..
    Note : I have used the oracle SQL Developer for testing the query.
    It would be appriciated if anybody helps me to improve the perfomance of the query.
    Below are the querie with and without functions:
    1. Query with functions:
    select
    imsAuditEvent12.id as ID,
    imsAuditEvent12.audit_time as AUDIT_TIME,
    imsAuditEvent12.admin_dn as ADMIN_DN,
    imsAuditEvent12.admin_name as ADMIN_NAME,
    imsAuditEvent12.event_name as EVENT_NAME,
    imsAuditEvent12.event_description as EVENT_DESCRIPTION,
    imsAuditEvent12.event_state as EVENT_STATE,
    imsAuditEvent12.envname as ENVNAME,
    imsAuditTaskSession12.task_name as TASK_NAME,
    imsAuditTaskSession12.id as TASK_ID,
    imsAuditTaskSession12.task_description as TASK_DESCRIPTION,
    imsAuditTaskSession12.task_priority as TASK_PRIORITY,
    S1.OBJECT_ID,
    S1.OBJECT_NAME as OBJECT_NAME,
    S1.OBJECT_TYPE as OBJECT_TYPE,
    S2.ATTRIBUTE_NAME as ATTRIBUTE_NAME,
    S2.ATTRIBUTE_OLDVALUES as ATTRIBUTE_OLDVALUES,
    S2.ATTRIBUTE_NEWVALUES as ATTRIBUTE_NEWVALUES,
    S3.OBJECT_DN as OBJECT_DN,
    S3.OBJECT_TYPE as IMSOBJECT_TYPE,
    S3.CONTAINER_NAME as CONTAINER_NAME,
    S3.CONTAINER_DN as CONTAINER_DN,
    S3.CONTAINER_TYPE as CONTAINER_TYPE
    from
    imsAuditEvent12 LEFT JOIN imsAuditTaskSession12 ON imsAuditTaskSession12.id=imsAuditEvent12.tasksession_id LEFT JOIN
    (select parent_event_id,
    ca_concat('imsAuditEventObject12.parent_event_id',parent_event_id,'imsAuditEventObject12.object_name','imsAuditEventObject12') as OBJECT_NAME,
    ca_concat('imsAuditEventObject12.parent_event_id',parent_event_id,'imsAuditEventObject12.object_type','imsAuditEventObject12') as OBJECT_TYPE,
    ca_concat_noseq('imsAuditEventObject12.parent_event_id',parent_event_id,'imsAuditEventObject12.ID','imsAuditEventObject12') as OBJECT_ID
    from
    imsAuditEventObject12 group by parent_event_id) S1
    ON imsAuditEvent12.id = S1.parent_event_id LEFT JOIN
    (select
    parent_object_id,
    ca_concat('parent_object_id',parent_object_id,'attribute_name','imsauditobjectattributes12') as ATTRIBUTE_NAME,
    ca_concat('parent_object_id',parent_object_id,'attribute_oldvalue','imsauditobjectattributes12') as ATTRIBUTE_OLDVALUES ,
    ca_concat('parent_object_id',parent_object_id,'attribute_newvalue','imsauditobjectattributes12') as ATTRIBUTE_NEWVALUES
    from
    imsauditobjectattributes12 group by parent_object_id) S2
    ON S1.OBJECT_ID = S2.parent_object_id LEFT JOIN
    (select
    parent_event_id,
    ca_concat('parent_event_id',parent_event_id,'OBJECT_DN','imsauditobjectrelationship12') as OBJECT_DN,
    ca_concat('parent_event_id',parent_event_id,'OBJECT_TYPE','imsauditobjectrelationship12') as OBJECT_TYPE ,
    ca_concat('parent_event_id',parent_event_id,'CONTAINER_NAME','imsauditobjectrelationship12') as CONTAINER_NAME,
    ca_concat('parent_event_id',parent_event_id,'CONTAINER_DN','imsauditobjectrelationship12') as CONTAINER_DN,
    ca_concat('parent_event_id',parent_event_id,'CONTAINER_TYPE','imsauditobjectrelationship12') as CONTAINER_TYPE
    from
    imsauditobjectrelationship12 group by parent_event_id) S3
    ON imsAuditEvent12.id =S3.parent_event_id where imsauditevent12.id > 0 and imsauditevent12.id <12000 order by imsauditevent12.id ASC;
    2. Query without using functions:
    select * from imsauditeventobject12 left join imsauditevent12 on imsauditeventobject12.id=imsauditevent12.id left join imsauditobjectattributes12 on imsauditeventobject12.id=imsauditobjectattributes12.parent_object_id left join imsaudittasksession12 on imsauditevent12.tasksession_id=imsaudittasksession12.id left join imsAuditObjectRelationship12 on imsAuditEvent12.id =imsAuditObjectRelationship12.parent_event_id where imsauditevent12.id >0 and imsauditevent12.id < 12000 order by imsauditevent12.id asc;
    Thanks,
    Badri

    Hi,
    Please find the below more information about the query.
    DB version: Oracle 11g Enterprise Edition Release 11.2.0.1.0
    Below are source of the functions:
    create or replace function ca_concat( ca_key_name in varchar2,
                           ca_key_val  in varchar2,
                           ca_other_col_name in varchar2,
                           ca_tname     in varchar2 )
       return varchar2
          as
           type rc is ref cursor;
           l_str    varchar2(32000);
           l_sep    varchar2(1);
           l_val    varchar2(32000);
           l_count   number(6);
           l_cur    rc;
       begin
       l_count :=1;
       l_str := '';
           open l_cur for 'select '|| ca_other_col_name ||'
                             from '|| ca_tname || '
                            where ' || ca_key_name || ' = '
                       using ca_key_val;
           loop
               fetch l_cur into l_val;
               l_val := SUBSTR(l_val,0,102);
               exit when (l_cur%notfound or l_count > 38);
               l_str := l_str || l_sep || l_count || '.' || l_val;
               l_sep := ',';
           l_count := l_count + 1;
           end loop;
           close l_cur;
           return l_str;
       end;
      create or replace function ca_concat_noseq( ca_key_name in varchar2,
                           ca_key_val  in varchar2,
                           ca_other_col_name in varchar2,
                           ca_tname     in varchar2 )
       return varchar2
          as
           type rc is ref cursor;
           l_str    nvarchar2(32000);
           l_sep    varchar2(1);
           l_val    varchar2(32000);
           l_count   number(6);
           l_cur    rc;
       begin
       l_count :=1;
           open l_cur for 'select '||ca_other_col_name||'
                             from '|| ca_tname || '
                            where ' || ca_key_name || ' = '
                       using ca_key_val;
           loop
               fetch l_cur into l_val;
               exit when (l_cur%notfound or length(l_val)>3000 or l_count>1);
               l_str := l_str || l_sep || l_val ;
               l_sep := ',';
           l_count := l_count + 1;
           end loop;
           close l_cur;
           return l_str;
    end;
    Below are the tables structures:
    DESC imsauditevent12;
    Name                           Null     Type                                                                                                                                                                                      
    ID                             NOT NULL NUMBER                                                                                                                                                                                       
    TASKSESSION_ID                 NOT NULL NUMBER                                                                                                                                                                                       
    TASKSESSION_OID                         VARCHAR2(100)                                                                                                                                                                                
    PARENT_EVENT_OID                        VARCHAR2(100)                                                                                                                                                                                
    AUDIT_TIME                     NOT NULL TIMESTAMP(6)                                                                                                                                                                                 
    EVENT_OID                      NOT NULL VARCHAR2(100)                                                                                                                                                                                
    ADMIN_DN                       NOT NULL VARCHAR2(512)                                                                                                                                                                                
    ADMIN_NAME                              VARCHAR2(255)                                                                                                                                                                                
    EVENT_NAME                     NOT NULL VARCHAR2(255)                                                                                                                                                                                
    EVENT_DESCRIPTION                       VARCHAR2(4000)                                                                                                                                                                               
    EVENT_STATE                             VARCHAR2(100)                                                                                                                                                                                
    ENVNAME                        NOT NULL VARCHAR2(100)                                                                                                                                                                                
    ENV_OID                        NOT NULL VARCHAR2(100)                                                                                                                                                                                
    DESC imsauditeventobject12;
    Name                           Null     Type                                                                                                                                                                                         
    ID                             NOT NULL NUMBER                                                                                                                                                                                       
    PARENT_EVENT_ID                NOT NULL NUMBER                                                                                                                                                                                       
    AUDIT_TIME                     NOT NULL TIMESTAMP(6)                                                                                                                                                                                 
    OBJECT_TYPE                    NOT NULL VARCHAR2(100)                                                                                                                                                                                
    OBJECT_NAME                             VARCHAR2(255)                                                                                                                                                                                
    DESC imsauditobjectattributes12;
    Name                           Null     Type                                                                                                                                                                                         
    ID                             NOT NULL NUMBER                                                                                                                                                                                       
    PARENT_OBJECT_ID               NOT NULL NUMBER                                                                                                                                                                                       
    AUDIT_TIME                     NOT NULL TIMESTAMP(6)                                                                                                                                                                                 
    DISPLAY_NAME                            VARCHAR2(255)                                                                                                                                                                                
    ATTRIBUTE_NAME                 NOT NULL VARCHAR2(255)                                                                                                                                                                                
    ATTRIBUTE_OLDVALUE                      VARCHAR2(4000)                                                                                                                                                                               
    ATTRIBUTE_NEWVALUE                      VARCHAR2(4000)                                                                                                                                                                               
    DESC imsaudittasksession12;
    Name                           Null     Type                                                                                                                                                                                         
    ID                             NOT NULL NUMBER                                                                                                                                                                                       
    PARENT_TS_OID                           VARCHAR2(100)                                                                                                                                                                                
    PARENT_EVENT_OID                        VARCHAR2(100)                                                                                                                                                                                
    AUDIT_TIME                     NOT NULL TIMESTAMP(6)                                                                                                                                                                                 
    TASKSESSION_OID                NOT NULL VARCHAR2(100)                                                                                                                                                                                
    ADMIN_DN                       NOT NULL VARCHAR2(512)                                                                                                                                                                                
    ADMIN_NAME                              VARCHAR2(255)                                                                                                                                                                                
    TASK_NAME                               VARCHAR2(255)                                                                                                                                                                                
    TASK_TAG                       NOT NULL VARCHAR2(255)                                                                                                                                                                                
    TASK_DESCRIPTION                        VARCHAR2(4000)                                                                                                                                                                               
    TASK_PRIORITY                           NUMBER                                                                                                                                                                                       
    STATE                          NOT NULL VARCHAR2(100)                                                                                                                                                                                
    ENVNAME                        NOT NULL VARCHAR2(100)                                                                                                                                                                                
    ENV_OID                        NOT NULL VARCHAR2(100)                                                                                                                                                                
    DESC imsAuditObjectRelationship12;
    Name                           Null     Type                                                                                                                                                                                         
    ID                             NOT NULL NUMBER                                                                                                                                                                                       
    PARENT_EVENT_ID                NOT NULL NUMBER                                                                                                                                                                                       
    AUDIT_TIME                     NOT NULL TIMESTAMP(6)                                                                                                                                                                                 
    OBJECT_TYPE                    NOT NULL VARCHAR2(100)                                                                                                                                                                                
    OBJECT_DN                      NOT NULL VARCHAR2(512)                                                                                                                                                                                
    CONTAINER_TYPE                 NOT NULL VARCHAR2(100)                                                                                                                                                                                
    OBJECT_NAME                    NOT NULL VARCHAR2(255)                                                                                                                                                                                
    CONTAINER_NAME                 NOT NULL VARCHAR2(255)                                                                                                                                                                                
    CONTAINER_DN                   NOT NULL VARCHAR2(512)                                                                                                                                                                          
    OPERATION                      NOT NULL VARCHAR2(50)                                                                                                                                                                                 
    Thanks,
    Badri

  • SELECT from table vs. CALL FUNCTION

    Hello,
    I have always wondered what the "best practice" is in this case, so I am looking for input.  When writing custom reports etc. in SAP, is it generally regarded as better practice to write a SELECT statement to get a line from say a Txxx configuration table, or is it best to use an associated BAPI or call to function module?  I know in some cases perfomance must obvioulsy be considered, but in terms of SAP's recommendations or upgrade considerations, which is typically better? 
    Assume for example something as simple as getting company code data...  Is it best to do <b>SELECT * FROM T001...</b> or to call a BAPI like <b>BAPI_COMPANYCODE_GETDETAIL</b>?
    Any feedback would be greatly appreciated.

    Hi
    Never accusing people of regarding performance, however I emphasize safety while developing. Even if it is a T* table, I try to use a standard function or call a subroutine of a standard program doing the work. I feel safer this way. Nevertheless, when I can't find any suitable (as of its interface), I use direct SELECT statements.
    If it is a simple report program then doing direct selects may be tolerable. However, if it is a more sophisticated one, especially if it deals with database updates, I highly recommend to use standards.
    As another way, I am aware you mean simple tables, but by the way, if it has a functional relation with a business entity (e.g. pa0001 for employee), I regard it as mandatory using standard FMs where applicable (I feel myself obliged to call "HR_READ_INFOTYPE" instead of using "SELECT* FROM PA0001...").
    *--Serdar

  • Fetching materials on basis of Division creating perfomance problem

    Hi Experts,
    i am fetching Data from three table like
    select a~matnr a~extwg
    b~charg b~werks b~clabs b~cspem b~cinsm
    c~vfdat
    from mara as a join mchb as b
    on a~matnr = b~matnr join mch1 as c on b~matnr = c~matnr  and b~charg = c~charg
    into table  itab_main
    where  a~spart = p_spart and b~werks = p_werks
    and b~lgort = 'FG01' .
    it is creating perfomance problem
    so my questin is 'is there any index table for mara ?(like vrpma for vbak)'
    so we can get all the material on base of division fast.
    Regards,
    Alpesh
    Edited by: Alpesh on Jun 2, 2009 3:56 PM

    Hi Alpesh,
    How about throwing MARC into the mix. I notice that you are searching with plant, storage location and division. Table MARC has an index on plant named WRK.
    If you join MARA and MARC to first determine all the materials that qualify for the given plant and division combination, you can access table MCHB with material (MARA-MATNR), plant (MARC-WERKS) and storage location (FG01) i.e. the first 4 fields in the primary key of table MCHB.
    I could not test this theory out because in our system we do not have any data in table MCHB. Your select executes quickly on my system.
    Please let me know how this panned out.

  • Change pointer perfomance issue(bd22)

    Hi,
    we are using message type HRMD_A to transfer the employee change data using the program RBDMIDOC. we are checking two table BDCP n BDCPS, but because of large number of data we r facing a perfomance issue here. I read in one forum about transaction BD22 which deletes the change pointer from these tables, but is it safe to use? and also what is the obsolete change pointer?
    Thanks in advance for ur inputs.

    Hey,
    It is advisable to reorganize change pointer tables at regular intervals for better performance of programs accessing the BDCP* tables.
    BD22 is a standard report delivered by SAP and it is absolutely safe to run this report. It also has o test run option. You could always run the report in test mode to analyze the data the report had selected for deletion.
    Obsolete change pointers are those which have been created up to the specified date and time. In BD22, if this checkbox is marked, obsolete change pointers will be reorganized regardless of whether they have yet been processed.                                                           
    Processed change pointers are those which have been processed in the specified period (date and time). If this checkbox is marked, the processed change pointers are reorganized.                          
    -Kiran
    *Please mark useful answers

  • How to improve perfomance in database operations

    In my programme i do some select, insert operations many time. so when i run my program with atlease 80000 customer data it takes 1 hrs to complete the task.
    So i switched to use threads. So i use n number of threads and gave a new connection to each thread and splited my customer data for each threads. so each thread contain 80000/n data.
    when i check the perfomance both (with and without thread) are equal
    so help me to improve the perfomance :)

    s friend. most of the time it invokes the database operations. i use addbatchs to execute the code. wait i will give the timelines,
    :AbstractRuleBasedScenario:run:test2---- is the time to execute the query
    :pool-1-thread-1:KYCScenarioTask:call:pool-1-thread-1---- is the time to run a thread
    with 1 thread
    01/04/07 10-33:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 62
    01/04/07 10-33:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 0
    01/04/07 10-33:pool-1-thread-1:KYCScenarioTask:call:pool-1-thread-1 ::: 94
    01/04/07 10-33:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 63
    01/04/07 10-33:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 31
    01/04/07 10-33:pool-1-thread-1:KYCScenarioTask:call:pool-1-thread-1 ::: 125
    01/04/07 10-33:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 63
    01/04/07 10-33:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 0
    01/04/07 10-33:pool-1-thread-1:KYCScenarioTask:call:pool-1-thread-1 ::: 109
    with 5 threads[
    01/04/07 10-29:pool-1-thread-3:AbstractRuleBasedScenario:run:test2 Time:::: 125
    01/04/07 10-29:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 125
    01/04/07 10-29:pool-1-thread-2:AbstractRuleBasedScenario:run:test2 Time:::: 62
    01/04/07 10-29:pool-1-thread-2:KYCScenarioTask:call:pool-1-thread-2 ::: 266
    01/04/07 10-29:pool-1-thread-4:AbstractRuleBasedScenario:run:test2 Time:::: 32
    01/04/07 10-29:pool-1-thread-3:AbstractRuleBasedScenario:run:test2 Time:::: 63
    01/04/07 10-29:pool-1-thread-1:AbstractRuleBasedScenario:run:test2 Time:::: 47
    01/04/07 10-29:pool-1-thread-4:KYCScenarioTask:call:pool-1-thread-4 ::: 281
    01/04/07 10-29:pool-1-thread-3:KYCScenarioTask:call:pool-1-thread-3 ::: 312
    01/04/07 10-29:pool-1-thread-1:KYCScenarioTask:call:pool-1-thread-1 ::: 250

  • How to improve sql perfomance/access speed by altering session parameters

    Dear friends
    how to improve sql perfomance/access speed by altering the session parameters? without altering indexes & sql expression
    regrads
    Edited by: sak on Mar 14, 2011 2:10 PM
    Edited by: sak on Mar 14, 2011 2:43 PM

    One can try:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:3696883368520
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:5180609822543
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/memory.htm#sthref497
    But make sure you understand the caveats you can run into!
    It would be better to post the outcome of select * from v$version; first.
    Also and execution plan would be nice to see.
    See:
    When your query takes too long ...
    HOW TO: Post a SQL statement tuning request - template posting

Maybe you are looking for