It's taking too much time(more than 10 min)

Hi All,
Below query is taking more time.I need to tune this.
Could you some one help to tune or give me new idea for re-write the query.
1) Database version
Version: 10.2.0.3.02)Query
SELECT    COUNT(C.ITEM_RESPONSE_ID) cnt,c.item_id
    FROM     CAT_ITEM_USER_RESPONSE C, TEST_SESSION_DETAIL T,
    TEST_SESSION S, TEST_DETAIL D, INSTITUTION E,cat_item_parameter g
    WHERE    D.TEST_DETAIL_ID = 1 
    AND     TRUNC(T.TEST_END_DATE) BETWEEN ADD_MONTHS(TO_DATE('01-AUG-09','DD-MON-YY'),-48)
    AND     TO_DATE('31-AUG-2009','DD-MON-YY')
    AND     T.TEST_SESSION_STATUS_ID = 3
    AND     C.RESTART_FLAG=0
    and     pretest=1
    AND     S.INSTITUTION_ID=E.INSTITUTION_ID
    AND     SUBSTR(E.INSTITUTION_ID_DISPLAY,8,3) <> '000'
    AND     T.TEST_DETAIL_ID = D.TEST_DETAIL_ID
    AND     S.TEST_SESSION_ID = T.TEST_SESSION_ID
    AND     C.TEST_SESSION_DETAIL_ID = T.TEST_SESSION_DETAIL_ID
    AND     G.ITEM_ID = C.ITEM_ID group by c.item_id3)Explain plan
explain plan succeeded.
PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                                                                           
Plan hash value: 3230521769                                                                                                                                                                                                                                                                                 
| Id  | Operation                                  | Name                        | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |                                                                                                                                                                  
|   0 | SELECT STATEMENT                           |                             |  1340 |    99K|   104K  (1)| 00:20:56 |       |       |                                                                                                                                                                  
|   1 |  HASH GROUP BY                             |                             |  1340 |    99K|   104K  (1)| 00:20:56 |       |       |                                                                                                                                                                  
|*  2 |   FILTER                                   |                             |       |       |            |          |       |       |                                                                                                                                                                  
|*  3 |    HASH JOIN                               |                             |   116K|  8624K|   104K  (1)| 00:20:56 |       |       |                                                                                                                                                                  
|   4 |     PARTITION HASH ALL                     |                             |  2312 | 18496 |    25   (0)| 00:00:01 |     1 |     5 |                                                                                                                                                                  
|*  5 |      TABLE ACCESS FULL                     | CAT_ITEM_PARAMETER          |  2312 | 18496 |    25   (0)| 00:00:01 |     1 |     5 |                                                                                                                                                                  
|*  6 |     TABLE ACCESS BY GLOBAL INDEX ROWID     | CAT_ITEM_USER_RESPONSE      |    19 |   228 |    17   (0)| 00:00:01 | ROWID | ROWID |                                                                                                                                                                  
|   7 |      NESTED LOOPS                          |                             |   116K|  7716K|   104K  (1)| 00:20:56 |       |       |                                                                                                                                                                  
|*  8 |       HASH JOIN                            |                             |  6279 |   343K|  6325   (1)| 00:01:16 |       |       |                                                                                                                                                                  
|*  9 |        INDEX FAST FULL SCAN                | INSTI_ID_NAME_COUN_DISP_IDX |  7571 |   103K|    17   (0)| 00:00:01 |       |       |                                                                                                                                                                  
|* 10 |        HASH JOIN                           |                             |  6280 |   257K|  6307   (1)| 00:01:16 |       |       |                                                                                                                                                                  
|  11 |         NESTED LOOPS                       |                             |  6330 |   197K|  4641   (1)| 00:00:56 |       |       |                                                                                                                                                                  
|  12 |          PARTITION HASH SINGLE             |                             |     1 |     5 |     0   (0)| 00:00:01 |     4 |     4 |                                                                                                                                                                  
|* 13 |           INDEX UNIQUE SCAN                | PK_TEST_DETAIL_NEW          |     1 |     5 |     0   (0)| 00:00:01 |     4 |     4 |                                                                                                                                                                  
|* 14 |          TABLE ACCESS BY GLOBAL INDEX ROWID| TEST_SESSION_DETAIL         |  6330 |   166K|  4641   (1)| 00:00:56 | ROWID | ROWID |                                                                                                                                                                  
|* 15 |           INDEX RANGE SCAN                 | TEST_SESSION_DETAIL_FK2_I   | 26065 |       |    68   (0)| 00:00:01 |       |       |                                                                                                                                                                  
|  16 |         INDEX FAST FULL SCAN               | TEST_SESSION_AK_1           |  1182K|    11M|  1661   (1)| 00:00:20 |       |       |                                                                                                                                                                  
|* 17 |       INDEX RANGE SCAN                     | CAT_ITEM_USER_RESP_IDX1     |    19 |       |     2   (0)| 00:00:01 |       |       |                                                                                                                                                                  
Predicate Information (identified by operation id):                                                                                                                                                                                                                                                         
   2 - filter(ADD_MONTHS(TO_DATE('01-AUG-09','DD-MON-YY'),-48)<=TO_DATE('2009-08-31 00:00:00', 'yyyy-mm-dd hh24:mi:ss'))                                                                                                                                                                                    
   3 - access("G"."ITEM_ID"="C"."ITEM_ID")                                                                                                                                                                                                                                                                  
   5 - filter("PRETEST"=1)                                                                                                                                                                                                                                                                                  
   6 - filter(TO_NUMBER("C"."RESTART_FLAG")=0)                                                                                                                                                                                                                                                              
   8 - access("S"."INSTITUTION_ID"="E"."INSTITUTION_ID")                                                                                                                                                                                                                                                    
   9 - filter(SUBSTR("E"."INSTITUTION_ID_DISPLAY",8,3)<>'000')                                                                                                                                                                                                                                              
  10 - access("S"."TEST_SESSION_ID"="T"."TEST_SESSION_ID")                                                                                                                                                                                                                                                  
  13 - access("D"."TEST_DETAIL_ID"=1)                                                                                                                                                                                                                                                                       
  14 - filter("T"."TEST_SESSION_STATUS_ID"=3 AND TRUNC(INTERNAL_FUNCTION("T"."TEST_END_DATE"))<=TO_DATE('2009-08-31 00:00:00',                                                                                                                                                                              
              'yyyy-mm-dd hh24:mi:ss') AND TRUNC(INTERNAL_FUNCTION("T"."TEST_END_DATE"))>=ADD_MONTHS(TO_DATE('01-AUG-09','DD-MON-YY'),-48))                                                                                                                                                                 
  15 - access("T"."TEST_DETAIL_ID"=1)                                                                                                                                                                                                                                                                       
  17 - access("C"."TEST_SESSION_DETAIL_ID"="T"."TEST_SESSION_DETAIL_ID")                                                                                                                                                                                                                                    

user575115 wrote:
2)Query
SELECT    COUNT(C.ITEM_RESPONSE_ID) cnt,c.item_id
FROM     CAT_ITEM_USER_RESPONSE C, TEST_SESSION_DETAIL T,
TEST_SESSION S, TEST_DETAIL D, INSTITUTION E,cat_item_parameter g
WHERE    D.TEST_DETAIL_ID = 1 
AND     TRUNC(T.TEST_END_DATE) BETWEEN ADD_MONTHS(TO_DATE('01-AUG-09','DD-MON-YY'),-48)
AND     TO_DATE('31-AUG-2009','DD-MON-YY')
AND     T.TEST_SESSION_STATUS_ID = 3
AND     C.RESTART_FLAG=0
and     pretest=1
AND     S.INSTITUTION_ID=E.INSTITUTION_ID
AND     SUBSTR(E.INSTITUTION_ID_DISPLAY,8,3) <> '000'
AND     T.TEST_DETAIL_ID = D.TEST_DETAIL_ID
AND     S.TEST_SESSION_ID = T.TEST_SESSION_ID
AND     C.TEST_SESSION_DETAIL_ID = T.TEST_SESSION_DETAIL_ID
AND     G.ITEM_ID = C.ITEM_ID group by c.item_id
Do you have a function based index for TRUNC(T.TEST_END_DATE) and SUBSTR(E.INSTITUTION_ID_DISPLAY,8,3)?
They are the first things that are obvious.

Similar Messages

  • Query is taking too much time

    hi
    The following query is taking too much time (more than 30 minutes), working with 11g.
    The table has three columns rid, ida, geometry and index has been created on all columns.
    The table has around 5,40,000 records of point geometries.
    Please help me with your suggestions. I want to select duplicate point geometry where ida=CORD.
    SQL> select a.rid, b.rid from totalrecords a, totalrecords b where a.ida='CORD' and b.idat='CORD' and
    sdo_equal(a.geometry, b.geometry)='TRUE' and a.rid !=b.rid order by 1,2;
    regards

    I have removed some AND conditions That was not necessary. It's just that Oracle can see for example that
    a.ida='CORD' AND
    b.idat='CORD' AND
    a.rid !=b.rid AND
    sdo_equal(a.geometry, b.geometry)='TRUE'
    ORDER BY 1,2;if a.ida does not equal 'CORD', the whole set of conditions evaluates to FALSE, so Oracle will not bother evaluating the rest of the conditions because it's all AND'ed together, and TRUE AND FALSE = FALSE.
    So if you place your least expensive conditions first (even though the optimizer can and will reorder conditions) this will give you a small performance benefit. Too small to notice, but on 5.4 million records it should be noticable.
    and I have set layer_gtype=POINT.Good, that will help. I forgot about that one (Thanks Luc!).
    Now i am facing the problem to DELETE duplicate point geometry. The following query is taking too much time. What is too much time? Do you need to delete these duplicate points on a daily or hourly basis? Or is this a one-time cleanup action? If it's a one-time cleanup operation, does it really matter if it takes half an hour?
    And if this is a daily or even hourly operation, then why don't you prevent the duplicates from entering the table in the first place? That will save you from having to clean up afterwards. Of course, this might not be possible with your business requirements.
    Lastly: can you post an explain plan for your queries? Those might give us an idea of what is taking so much time. Please enclose the results of the explain plan with
    [ c o d e ]
    <code/results here>
    [ / c o d e ]
    that way the original formatting is kept and it makes things much easier to read.
    Regards,
    Stefan

  • Oracle 11G + Database Connection taking too much Time

    Hi ,
    I am using Oracle 11G . When i try to connect to oracle database
    sqlplus system/impetus@database
    it takes too much time ( more than 1 min )
    I am not getting why this is happening ?
    Before some day it was working fine but suddenly the problem occurred.. Is this issue is related to log files generated by oracle or memory related issue ( sga and pga)..
    Any Help please ?

    Darn! /tmp/capture.log does not contain what I expected it to contain.
    So a different approach is needed.
    issue the following command:
    script /tmp/capture.log
    #now you are in a new shell & issue the next 3 lines
    strace sqlplus system/impetus@database
    exit
    Ctrl-d (Control D)
    now issue the following commands.
    ls -l /tmp/capture.log
    wc -l /tmp/capture.log
    Post the results from 2 commands above back here

  • Taking too much time for saving PO with line item more than 600

    HI
    We are trying to save PO with line items more than 600, but it is taking too much time to save. It is taking more than 1 hour to save the PO.
    Kindly let me know is there any restriction for no. of line items in the PO. Pls guide
    regards
    Sanjay

    Hi,
    I suggest you to do a trace (tcode ST05) to identify the bottleneck.
    You can know some reasons in Note 205005 - Performance composite note: Purchase order.
    I hope this helps you
    Regards
    Eduardo

  • Why it is taking too much time to kill the process?

    Hi All,
    Today,one of my user ran the calc script and the process is taking too much time, then i kill the process. I am wondering about one thing here even it is taking too long to kill the process, generally it will not take more than 2 sec. I did this through EAS.
    After that I ran Maxl statement
    alter system kill request 552599515;
    there is no use at all.
    Please reply if you have any solutions to kill this process.
    Thanks in advance.
    Ram.

    Hi Ram,
    1. Firstly, How much time does your calculation scripts normally run.
    2. While it was running, you can go to the logs and monitor where exactly the script is taking time .
    3. Sometimes, it does take time to cancel a transaction ( as it might be in between).
    4. Maxl is always good to kill ,as you did . It should be succesful . Check the logs what it says ,and also the "sessions" which might say "terminating" and finish it off.
    5. If nothing works ,and in the worst case scenarion , if its taking time without doing anything. Then log off all the users and stop the databas and start it .
    6. Do log off all the users, so that you dont corrupt any filter related sec file.
    Be very careful , if its production ( and I assume you have latest backups)
    Sandeep Reddy Enti
    HCC
    http://hyperionconsultancy.com/

  • Delete query taking too much time

    Hi All,
    my delete query is taking too much time. around 1hr 30 min for 1.5 lac records.
    Though I have dropped mv log on the table & disabled all the triggers on it.
    Moreover deletion is based on primary key .
    delete from table_name where primary_key in (values)
    above is dummy format of my query.
    can anyone please tell me what could be other reason that query is performing that slow.
    Is there anything to check in DB other than triggers,mv log,constraints in order to improve the performance?
    Please reply asap.

    Delete is the most time consuming operation, as the whole record data has to be stored at the undo segments. On the other hand, there is a part of the query used to select records to delete that probably is adding an extra overhead to the process, the in (values) clause. It would be nice on your side to post another dummy from this (values) clause. I could figure out this is a subquery, and in order for you to obtain this list you have to run a inefficient query.
    You can gather the execution plan so you can see where the most heavy part of th query is. This way a better tuning approach and a more accurate diagnostic can be issued.
    ~ Madrid.

  • Delta Sync taking too much time on refreshing of tables

    Hi,
    I am working on Smart Service Manager 3.0. I have come across a scenario where the delta sync is taking too much time.
    It is required that if we update the stock quantity then the stock should be updated instantaneously.
    To do this we have to refresh 4 stock tables at every sync so that the updated quantity is reflected in the device.
    This is taking a lot of time (3 to 4 min) which is highly unacceptable from user perspective.
    Please could anyone suggest something so that  only those table get refreshed upon which the action is carried out.
    For eg: CTStock table should get refreshed only If i transfer a stock and get updated accordingly
    Not on any other scenario like the changing  status from accept to driving or any thing other than stocks.
    Thanks,
    Star
    Tags edited by: Michael Appleby

    Hi fiontan,
    Thanks a lot for the response!!!
    Yeah!! I kow it's a lotta code, but i thought it'd be more informative if the whole function was quoted.
    I'm in fact using the PrintWriter to wrap the BufferedWriter but am not using the print() method.
    Does it save any time by using the print() method??
    The place where the delay is occurring is the wile loop shown below:
                while(allitems.hasMoreElements()){
                String aRow = "";
                    XDItem item = (XDItem)allitems.nextElement();
                    for(int i =0 ; i < props.length; i++){
                         String value = item.getStringValue(props);
         if(value == null || value.equalsIgnoreCase("null"))
              value = "";
                             if(i == 0)
                                  aRow = value;
                             else
                                  aRow += ("\t" + value);
    startTime1 = System.currentTimeMillis();
    System.out.println("time here is--before-writing to buffer --out.flush() done: " +startTime1);
    bufferWrt.write(aRow.toCharArray());
    out.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.newLine();
    startTime2 = System.currentTimeMillis();
    System.out.println("time here is--after-writing to buffer : " +startTime2);
    What exactly happens is that after a few loops it just seems to sleep for around 20 seconds and then again starts off and ............it goes on till the records are done.
    Please do lemme know if you have any idea as to why this is happening !!!!! This bug is giving me the scare.
    thanks in advance

  • Taking too much time to load application

    Hi,
    I have deployed a j2ee application on oracle 10g version 10.1.2.0.2. But the application is taking too much time to load. After loading ,everything works fast.
    I have another 10g server (same version) in which the same application is loading very fast.
    When I checked the apache error logs found this :-
    [Thu Apr 26 09:17:31 2007] [warn] [client 10.1.20.9] oc4j_socket_recvfull timed out
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] (4)Interrupted system call: MOD_OC4J_0038: Receiving data from oc4j exceeded the configured "Timeout" value and the error code is 4.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0054: Failed to call network routine to receive an ajp13 message from oc4j.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0033: Failed to receive an ajp13 message from oc4j.
    [Thu Apr 26 09:17:31 2007] [warn] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0078: Network connection errors happened to host: lawdb.keralalawsect.org and port: 12501 while receiving the first response from oc4j. This request is recoverable.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0121: Failed to service request with network worker: home_15 and it is not recoverable.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0013: Failed to call destination: home's service() to service the request.
    [Thu Apr 26 11:36:36 2007] [notice] FastCGI: process manager initialized (pid 21177)
    [Thu Apr 26 11:36:37 2007] [notice] Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server configured -- resuming normal operations
    [Thu Apr 26 11:36:37 2007] [notice] Accept mutex: fcntl (Default: sysvsem)
    [Thu Apr 26 11:36:37 2007] [warn] long lost child came home! (pid 9124)
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0015: recv() returns 0. There has no message available to be received and oc4j has gracefully (orderly) closed the connection.
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0054: Failed to call network routine to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0033: Failed to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:39:51 2007] [warn] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0078: Network connection errors happened to host: lawdb.keralalawsect.org and port: 12501 while receiving the first response from oc4j. This request is recoverable.
    [Thu Apr 26 11:39:51 2007] [warn] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0184: Failed to find an oc4j process for destination: home
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0145: There is no oc4j process (for destination: home) available to service request.
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0119: Failed to get an oc4j process for destination: home
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0013: Failed to call destination: home's service() to service the request.
    [Thu Apr 26 11:46:33 2007] [notice] FastCGI: process manager initialized (pid 21726)
    [Thu Apr 26 11:46:34 2007] [notice] Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server configured -- resuming normal operations
    [Thu Apr 26 11:46:34 2007] [notice] Accept mutex: fcntl (Default: sysvsem)
    [Thu Apr 26 11:46:34 2007] [warn] long lost child came home! (pid 21182)
    [Thu Apr 26 11:53:32 2007] [warn] [client 10.1.20.9] oc4j_socket_recvfull timed out
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] (4)Interrupted system call: MOD_OC4J_0038: Receiving data from oc4j exceeded the configured "Timeout" value and the error code is 4.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0054: Failed to call network routine to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0033: Failed to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:53:32 2007] [warn] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0078: Network connection errors happened to host: lawdb.keralalawsect.org and port: 12501 while receiving the first response from oc4j. This request is recoverable.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0121: Failed to service request with network worker: home_15 and it is not recoverable.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0013: Failed to call destination: home's service() to service the request.
    Please HELP ME...

    Hi this is what the solution given by your link
    A.1.6 Connection Timeouts Through a Stateful Firewall Affect System Performance
    Problem
    To improve performance the mod_oc4j component in each Oracle HTTP Server process maintains open TCP connections to the AJP port within each OC4J instance it sends requests to.
    In situations where a firewall exists between OHS and OC4J, packages sent via AJP are rejected if the connections can be idle for periods in excess of the inactivity timeout of stateful firewalls.
    However, the AJP socket is not closed; as long as the socket remains open, the worker thread is tied to it and is never returned to the thread pool. OC4J will continue to create more threads, and will eventually exhaust system resources.
    Solution
    The OHS TCP connection must be kept "alive" to avoid firewall timeout issues. This can be accomplished using a combination of OC4J configuration parameters and Apache runtime properties.
    Set the following parameters in the httpd.conf or mod_oc4j.conf configuration files. Note that the value of Oc4jConnTimeout sets the length of inactivity, in seconds, before the session is considered inactive.
    Oc4jUserKeepalive on
    Oc4jConnTimeout 12000 (or a similar value)
    Also set the following AJP property at OC4J startup to enable OC4J to close AJP sockets in the event that a connection between OHS and OC4J is dropped due to a firewall timeout:
    ajp.keepalive=true
    For example:
    java -Dajp.keepalive=true -jar oc4j.jar
    Please tell me where or which file i should put the option
    java -Dajp.keepalive=true -jar oc4j.jar ??????/

  • Taking too much time in Rules(DTP Schedule run)

    Hi,
    I am Scheduling the DTP which have filters to minimize the load data.
    when i run the DTP it is taking too much time in the "rules" (i can see the  DTP monitor ststus package by pakage and step by step like "Start routine" "rules" and "End Routine")
    here it is consuming too much time in Rules Mapping.
    what is the problem and any solutions please...
    regards,
    sree

    Hi,
    Time taken at "rules" depends on the complexity involved there in ur routine. If it is a complex calculation it will take time.
    Also check ur DTP batch settings, ie how many no. of background processes used to perform  DTP, Job class.
    U can find these :
    goto DTP, select goto menu and select "Settings for Batch Manager".
    In the screen increase no of Processes from 3 to higher no(max 9).
    ChaNGE job class to 'A'.
    If ur DTP is still running , cancel it ie Kill the DTP, delete from the Cube,
    Change these settings and run ur DTP one more time.
    U can observer the difference.
    Reddy

  • Taking too much time using BufferedWriter to write to a file

    Hi,
    I'm using the method extractItems() which is given below to write data to a file. This method is taking too much time to execute when the number of records in the enumeration is 10000 and above. To be precise it takes around 70 minutes. The writing pauses intermittently for 20 seconds after writing a few lines and sometimes for much more. Has somebody faced this problem before and if so what could be the problem. This is a very high priority work and it would be really helpful if someone could give me some info on this.
    Thanks in advance.
    public String extractItems() throws InternalServerException{
    try{
                   String extractFileName = getExtractFileName();
                   FileWriter fileWriter = new FileWriter(extractFileName);
                   BufferedWriter bufferWrt = new BufferedWriter(fileWriter);
                   CXBusinessClassIfc editClass = new ExploreClassImpl(className, mdlMgr );
    System.out.println("Before -1");
                   CXPropertyInfoIfc[] propInfo = editClass.getClassPropertyInfo(configName);
    System.out.println("After -1");
              PrintWriter out = new PrintWriter(bufferWrt);
    System.out.println("Before -2");
              TemplateHeaderInfo.printHeaderInfo(propInfo, out, mdlMgr);
    System.out.println("After -2");
    XDItemSet itemSet = getItemsForObjectIds(catalogEditDO.getSelectedItems());
    Enumeration allitems = itemSet.allItems();
    System.out.println("the batch size : " +itemSet.getBatchSize());
    XDForm frm = itemSet.getXDForm();
    XDFormProperty[] props = frm.getXDFormProperties();
    System.out.println("Before -3");
    bufferWrt.newLine();
    long startTime ,startTime1 ,startTime2 ,startTime3;
    startTime = System.currentTimeMillis();
    System.out.println("time here is--before-while : " +startTime);
    while(allitems.hasMoreElements()){
    String aRow = "";
    XDItem item = (XDItem)allitems.nextElement();
    for(int i =0 ; i < props.length; i++){
         String value = item.getStringValue(props);
         if(value == null || value.equalsIgnoreCase("null"))
              value = "";
                             if(i == 0)
                                  aRow = value;
                             else
                                  aRow += ("\t" + value);
    startTime1 = System.currentTimeMillis();
    System.out.println("time here is--before-writing to buffer --new: " +startTime1);
    bufferWrt.write(aRow.toCharArray());
    bufferWrt.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.newLine();
    startTime2 = System.currentTimeMillis();
    System.out.println("time here is--after-writing to buffer : " +startTime2);
    startTime3 = System.currentTimeMillis();
    System.out.println("time here is--after-while : " +startTime3);
                   out.close();//added by rosmon to check extra time taken for extraction//
    bufferWrt.close();
    fileWriter.close();
    System.out.println("After -3");
    return extractFileName;
    catch(Exception e){
                   e.printStackTrace();
    throw new InternalServerException(e.getMessage());

    Hi fiontan,
    Thanks a lot for the response!!!
    Yeah!! I kow it's a lotta code, but i thought it'd be more informative if the whole function was quoted.
    I'm in fact using the PrintWriter to wrap the BufferedWriter but am not using the print() method.
    Does it save any time by using the print() method??
    The place where the delay is occurring is the wile loop shown below:
                while(allitems.hasMoreElements()){
                String aRow = "";
                    XDItem item = (XDItem)allitems.nextElement();
                    for(int i =0 ; i < props.length; i++){
                         String value = item.getStringValue(props);
         if(value == null || value.equalsIgnoreCase("null"))
              value = "";
                             if(i == 0)
                                  aRow = value;
                             else
                                  aRow += ("\t" + value);
    startTime1 = System.currentTimeMillis();
    System.out.println("time here is--before-writing to buffer --out.flush() done: " +startTime1);
    bufferWrt.write(aRow.toCharArray());
    out.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.newLine();
    startTime2 = System.currentTimeMillis();
    System.out.println("time here is--after-writing to buffer : " +startTime2);
    What exactly happens is that after a few loops it just seems to sleep for around 20 seconds and then again starts off and ............it goes on till the records are done.
    Please do lemme know if you have any idea as to why this is happening !!!!! This bug is giving me the scare.
    thanks in advance

  • Report taking too much time in the portal

    Hi freiends,
    we have developed a report on the ods,and we publish the same on the portal.
    the problem is when the users are executing the report at the same time it is taking too much time.because of this the perfoemance is very poor.
    is there any way to sort out this issue,like can we send the report to the individual user's mail id
    so that they can not log in to the portal
    or can we create the same report on the cube.
    what could be the main difference if the report made on the cube or ods?
    please help me
    thanks in advance
    sridath

    Hi
    Try this to improve performance of query
    Find the query Run-time
    where to find the query Run-time ?
    557870 'FAQ BW Query Performance'
    130696 - Performance trace in BW
    This info may be helpful.
    General tips
    Using aggregates and compression.
    Using less and complex cell definitions if possible.
    1. Avoid using too many nav. attr
    2. Avoid RKF and CKF
    3. Many chars in row.
    By using T-codes ST03 or ST03N
    Go to transaction ST03 > switch to expert mode > from left side menu > and there in system load history and distribution for a particular day > check query execution time.
    /people/andreas.vogel/blog/2007/04/08/statistical-records-part-4-how-to-read-st03n-datasets-from-db-in-nw2004
    /people/andreas.vogel/blog/2007/03/16/how-to-read-st03n-datasets-from-db
    Try table rsddstats to get the statistics
    Using cache memory will decrease the loading time of the report.
    Run reporting agent at night and sending results to email. This will ensure use of OLAP cache. So later report execution will retrieve the result faster from the OLAP cache.
    Also try
    1. Use different parameters in ST03 to see the two important parameters aggregation ratio and records transferred to F/E to DB selected.
    2. Use the program SAP_INFOCUBE_DESIGNS (Performance of BW infocubes) to see the aggregation ratio for the cube. If the cube does not appear in the list of this report, try to run RSRV checks on the cube and aggregates.
    Go to SE38 > Run the program SAP_INFOCUBE_DESIGNS
    It will shown dimension Vs Fact tables Size in percent.If you mean speed of queries on a cube as performance metric of cube,measure query runtime.
    3. To check the performance of the aggregates,see the columns valuation and usage in aggregates.
    Open the Aggregates...and observe VALUATION and USAGE columns.
    "---" sign is the valuation of the aggregate. You can say -3 is the valuation of the aggregate design and usage. ++ means that its compression is good and access is also more (in effect, performance is good). If you check its compression ratio, it must be good. -- means the compression ratio is not so good and access is also not so good (performance is not so good).The more is the positives...more is useful the aggregate and more it satisfies the number of queries. The greater the number of minus signs, the worse the evaluation of the aggregate. The larger the number of plus signs, the better the evaluation of the aggregate.
    if "-----" then it means it just an overhead. Aggregate can potentially be deleted and "+++++" means Aggregate is potentially very useful.
    In valuation column,if there are more positive sign it means that the aggregate performance is good and it is useful to have this aggregate.But if it has more negative sign it means we need not better use that aggregate.
    In usage column,we will come to know how far the aggregate has been used in query.
    Thus we can check the performance of the aggregate.
    Refer.
    http://help.sap.com/saphelp_nw70/helpdata/en/b8/23813b310c4a0ee10000000a114084/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/60/f0fb411e255f24e10000000a1550b0/frameset.htm
    performance ISSUE related to AGGREGATE
    Note 356732 - Performance Tuning for Queries with Aggregates
    Note 166433 - Options for finding aggregates (find optimal aggregates for an InfoCube)
    4. Run your query in RSRT and run the query in the debug mode. Select "Display Aggregates Found" and "Do not use cache" in the debug mode. This will tell you if it hit any aggregates while running. If it does not show any aggregates, you might want to redesign your aggregates for the query.
    Also your query performance can depend upon criteria and since you have given selection only on one infoprovider...just check if you are selecting huge amount of data in the report
    Check for the query read mode in RSRT.(whether its A,X or H)..advisable read mode is X.
    5. In BI 7 statistics need to be activated for ST03 and BI admin cockpit to work.
    By implementing BW Statistics Business Content - you need to install, feed data and through ready made reports which for analysis.
    http://help.sap.com/saphelp_nw70/helpdata/en/26/4bc0417951d117e10000000a155106/frameset.htm
    /people/vikash.agrawal/blog/2006/04/17/query-performance-150-is-aggregates-the-way-out-for-me
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    http://help.sap.com/saphelp_nw04/helpdata/en/c1/0dbf65e04311d286d6006008b32e84/frameset.htm
    You can go to T-Code DB20 which gives you all the performance related information like
    Partitions
    Databases
    Schemas
    Buffer Pools
    Tablespaces etc
    use tool RSDDK_CHECK_AGGREGATE in se38 to check for the corrupt aggregates
    If aggregates contain incorrect data, you must regenerate them.
    202469 - Using aggregate check tool
    Note 646402 - Programs for checking aggregates (as of BW 3.0B SP15)
    You can find out whether an aggregate is usefull or useless you can find out through a proccess of checking the tables RSDDSTATAGGRDEF*
    Run the query in RSRT with statistics execute and come back you will get STATUID... copy this and check in the table...
    This gives you exactly which infoobjects it's hitting, if any one of the object is missing it's useless aggregate.
    6
    Check SE11 > table RSDDAGGRDIR . You can find the last callup in the table.
    Generate Report in RSRT
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4c0ab590-0201-0010-bd9a-8332d8b4f09c
    Business Intelligence Journal Improving Query Performance in Data Warehouses
    http://www.tdwi.org/Publications/BIJournal/display.aspx?ID=7891
    Achieving BI Query Performance Building Business Intelligence
    http://www.dmreview.com/issues/20051001/1038109-1.html
    Assign points if useful
    Cheers
    SM

  • Importing is taking too much time (2 DAYS)

    Dear All,
    I'm Importing below support packages together in a queue @ SAP Solution manger 4  .
    SAPKB70015             Basis Support Package 15 for 7.00
    SAPKA70015             ABA Support Package 15 for 7.00
    SAPKITL426             ST 400: Patch 0016, CRT for SAPKB70015
    SAPKIBIIP6             BI_CONT 703: patch 0006
    SAPKIBIIP7             BI_CONT 703: patch 0007
    SAPKIBIIP8             BI_CONT 703: patch 0008
    SAPK-40010INCPRXRPM    CPRXRPM 400: patch 0010
    SAPK-40011INCPRXRPM    CPRXRPM 400: patch 0011
    SAPK-40012INCPRXRPM    CPRXRPM 400: patch 0012
    SAPKIPYJ7E             PI_BASIS 2005_1_700: patch 0014
    SAPKW70016             BW Support Package 16 for 7.00
    importing is taking too much time (2 DAYS) in main import phase, I have seen SLOG, there are many rows " I am waiting 1 sec and 6 sec . and also checked transaction code STMS all support packages  imported except  one support package "SAPKW70016  "
    Please advice.
    Best Regards'
    HE

    Hello Mohan,
    The DBTABLOG table does get large, the best is to switch off logging. If that's not possible, increase the frequency of your delete job, also explore one more alternative have a look at the archival object: BC_DBLOGS, you could archive old records (in accordance with your customer's data retention policies) to reduce the size of the table.
    Also, have a look at the following notes, they will advise you on how to improve the performance of your delete job:
    Note 531923 - Audit Trail: Indexes on table DBTABLOG
    Note 579980 - Table logs: Performance during access to DBTABLOG
    Regards,
    Siddhesh

  • Combining clob taking too much time - need help

    Hello,
    I want to append clob values into another clob value like
    declare
    v_temp clob;
    v_c1_temp clob;
    cursor c1 as select clob_data from t;
    -- here t table contains clob_data column holding clob data
    -- t table have more then 1500 rows
    begin
    v_temp := '';
    open c1 into v_c1_temp;
    loop
    v_temp := v_temp + v_c1_temp; --------- combining clob (concat may be used)
    end loop;
    close(c1);
    end;
    above part also repeats in outer loop (not shown here)
    my problem is :- it is taking too much time - you dont believe 90% more time due to that concatenation.
    is it any smart way to do same thing?
    It will be very helpful to me.

    Hi ,
    You should also always try and have the latest BI content patch installed but I don't think this is the problem. It seems that there
    are alot of objects to collect. Under 'grouping' you can select the option 'only necessary objects', please check if you can
    use this option to  install the objects that you need from content.
    Best Regards,
    Des.

  • Archive Delete job taking too much time - STXH Sequential Read

    Hello,
    We have been running Archive sessions in our production system in last couple of months. We use SARA and selecting the appropriate variants for WRITE, DELETE and STORAGE options.
    Currently we use the Archive object FI_DOCUMNT and the write job is finished as per the normal time (5 hrs based on the selection criteria). After that normally the delete job is used to complete in 1hr or less than 2hrs always (in last 3 months).
    But in last few days the delete job is taking too much to complete (around 8 - 10hrs) when I monitor the system found that the Sequential Read for table STXH is taking too much time to read and it seems this is the cause.
    Could you please provide a solution for the same, so that the job will run faster as earlier.
    Thanks for your time
    Shyl

    Hi Juan,
    After the statistics run the performance is quite good. Now the job getting finished as expected.
    Thanks. Problem solved
    Shyl

  • Server0 process taking too much time

    Hi All,
        Once i start the Netweaver server, the server) process taking too much time.
    When i was installed Netweaver that time 13 min, after 2 months 18 min.. then 25 min now it is taking 35 minutes.... to become green color.
    Why it is taking too much time, what might be the cause.....
    Give some ideas to solve this problem..............
    The server0 developer trace has this information continuously 6 to 7 times...
    [Thr 4204] *************** STISEND ***************
    [Thr 4204] STISEND: conversation_ID: 86244265
    [Thr 4204] STISEND: sending 427 bytes
    [Thr 4204] STISearchConv: found conv without search
    [Thr 4204] STISEND: send synchronously
    [Thr 4204] STISEND GW_TOTAL_SAPSEND_HDR_LEN: 88
    [Thr 4204] NiIWrite: hdl 0 sent data (wrt=515,pac=1,MESG_IO)
    [Thr 4204] STIAsSendToGw: Send to Gateway o.k.
    [Thr 4204] STIAsRcvFromGw: timeout value: -1
    [Thr 4204] NiIRead: hdl 0 recv would block (errno=EAGAIN)
    [Thr 4204] NiIRead: hdl 0 received data (rcd=3407,pac=2,MESG_IO)
    [Thr 4204] STIAsRcvFromGw: Receive from Gateway o.k.
    [Thr 4204] STISEND: data_received: CM_COMPLETE_DATA_RECEIVED
    [Thr 4204] STISEND: received_length: 3327
    [Thr 4204] STISEND: status_received: CM_SEND_RECEIVED
    [Thr 4204] STISEND: request_to_send_received: CM_REQ_TO_SEND_NOT_RECEIVED
    [Thr 4204] STISEND: ok
    [Thr 4204] STIRCV: new buffer state = BUFFER_EMPTY
    [Thr 4204] STIRCV: ok
    [Thr 4204] *************** STSEND ***************
    [Thr 4204] STSEND: conversation_ID: 86244265
    [Thr 4204] STISearchConv: found conv without search
    [Thr 4204] STSEND: new buffer state = BUFFER_DATA
    [Thr 4204] STSEND: 106 bytes buffered
    [Thr 4204] *************** STIRCV ***************
    [Thr 4204] STIRCV: conversation_ID: 86244265
    [Thr 4204] STIRCV: requested_length: 16000 bytes
    [Thr 4204] STISearchConv: found conv without search
    [Thr 4204] STIRCV: send 106 buffered bytes before receive
    [Thr 4204] STIRCV: new buffer state = BUFFER_DATA2
    [Thr 4204] *************** STISEND ***************
    then
    [Thr 4252] JHVM_NativeGetParam: get profile parameter DIR_PERF
    [Thr 4252] JHVM_NativeGetParam: return profile parameter DIR_PERF=C:\usr\sap\PRFCLOG
    this message continuously
    Can i have any solution for the above problem let me know .
    Thanks & regards,
    Sridhar M.

    Hello Manoj,
           Thanks for your quick response, Previously the server has 4GB RAM and now also it has same.
    Yesterday i found some more information, like deployed(through SDM) applications also take some memory at the time of starting the J2EE server...Is it right?
    Any other cause...let me know
    Thanks & Regards,
    Sridhar M.

Maybe you are looking for

  • Import image in table

    dear friends i have a table having primary key and i have a file containing image (JPG) files and are named same as primary kay have please guide me how to add one image in a file and how to add complete folder in the database against the primary key

  • Auto-preface attachments in mail?

    This is weird, but, is there a way to automatically add a preface to every attachment you send in mail? I'd like to put "mylastname_" before the files I send to people, for instance, teachers or coworkers, so they don't mix up my files from someone e

  • HT1414 I have restored my IPHONE and the problem still continues. No photo is save in camera roll since the new IOS6!

    I have restored my IPHONE and the problem still continues. No photo is save in camera roll since the new IOS6!

  • Mp3 player  with  built in speaker

    HI, I am looking for a basic mp3 player with a built in speaker under $100. I just want to listen to podcasts that I download on my macbook and then transfer to an mp3 player. I don't need video or lot of bells and whistles - but a built-in-speaker i

  • AMD Radeon HD 6970M 2048 MB - Control center, parameters?

    Hello, I received my new Imac 3,4, good computer. My only trouble is that I would like to have acces on my iMac to something that you can always find on a PC; a kind of Control Center (catalyst control Center), with all the parameters. I have some tr