RTF to HTML Converter (Performance Problem)

Hi there,
I've got a big performance problem in my RTF to HTML converter. The converter takes for instance 1300 characters up to 4 seconds.... overkill
Here is my code:
final RTFEditorKit rtf_edit = new RTFEditorKit();
final JTextPane jtp_rtf = new JTextPane();
final JTextPane jtp_html = new JTextPane();
final StyleContext rtf_context = new StyleContext();
final DefaultStyledDocument rtf_doc = new DefaultStyledDocument(rtf_context);
jtp_rtf.setEditorKit(rtf_edit);
jtp_rtf.setContentType("text/rtf");
jtp_html.setContentType("text/html");
try {
     rtf_edit.read(new StringReader(txt), rtf_doc, 0);
     jtp_rtf.setDocument(rtf_doc);
     jtp_html.setText(rtf_doc.getText(0, rtf_doc.getLength()));
     HTMLDocument html_doc = null;
     for (int i = 0; i < rtf_doc.getLength(); i++) {
          AttributeSet a = (AttributeSet) rtf_doc.getCharacterElement(i)
                    .getAttributes();
          AttributeSet p = (AttributeSet) rtf_doc.getParagraphElement(i)
                    .getAttributes();
          String s = jtp_rtf.getText(i, 1);
          jtp_html.select(i, i + 1);
          jtp_html.replaceSelection(s);
          html_doc = (HTMLDocument) jtp_html.getDocument();
          html_doc.putProperty("", "");
          html_doc.setCharacterAttributes(i, 1,
                    (javax.swing.text.AttributeSet) a, false);
          MutableAttributeSet attr = new SimpleAttributeSet(p);
          html_doc.setParagraphAttributes(i, 1, attr, false);
     StringWriter writer = new StringWriter();
     final HTMLEditorKit html_edit = new HTMLEditorKit();
     html_edit.write(writer, html_doc, 0, html_doc.getLength());
     return writer.toString();
} catch (Exception ex) {
     return " ";
}Thanks for any advice

Can you post code of your HTML page.. Thanks

Similar Messages

  • Serious performance problems on iWeb site

    Can anyone help me find the problem with peterlance.com? It looks like author Peter Lance uses iWeb to update his web site. He redesigned it recently (and did not use iWeb for the old design). Anyway, it has serious performance problems on Internet Explorer, which I was hoping you guys could help pinpoint? Is there something simple I can tell him to try to fix the problem? He is launching a new book on Tuesday so he will be getting a lot of traffic, but for now the response time is not very good. Any suggestions?
    In particular, each new page seems to hang for about ten seconds and freeze using Internet Explorer 6. Any fixes?
    I mean, fixes other than: "Don't use Internet Explorer!"
    http://www.peterlance.com/Peter%20Lance/Home/Home.html
    name="Generator" content="iWeb 1.1.2"

    Welcome to the discussions, TopDog08.
    There are several plain .jpg's and that's good, but you need to convert every .png on the page (or as many .png's as you can) to a .jpg. For example,
    http://www.peterlance.com/Peter%20Lance/Home/Homefiles/shapeimage46.png
    Convert that to a jpg, then replace the graphic and text on the iWeb page with this converted jpg (some have has success using Downsize http://www.stuntsoftware.com/Downsize/)
    The ones you won't be able to do anything about are the ones that are a part of the blog, but that will be only 5 images instead of the many you have now.
    This image
    http://www.peterlance.com/Peter%20Lance/Home/Homefiles/shapeimage50.png
    Is covering part of your menu which is why it appears that only the top half is sensitive to rolling over. You'll have to adjust your layout to account for this.
    Another area to look at, there are white boxed png's surrounding the amazon book covers at the top.
    http://www.peterlance.com/Peter%20Lance/Home/Homefiles/imageEffectsAboveAli%20Mug%20TPI%20jpg.png
    Another set of .png's you'll have to get rid of. How did those get put on the page?
    What you see happening with IE is a java script running to fix IE's problem with png's. The fewer .png's you have, the less of a problem with IE you have.

  • JRC 2: Performance Problem

    Hi.
    Our reporting component used JRC 1.x before we upgraded to JRC 2.x. We got two issues after upgrading.
    First issue I solved already with a workaround which I published on stackoverflow.com. (1) Does anyone knows where I will find the issue management system to report this issue?
    Second issue occurs big performance problem within our project. We opened a report with 6 subreports (which includes 1 upto 3 tables) in 2-4 seconds using JRC 1. If we will open same report using JRC 2, we wait upto 60 seconds.
    This methods requires more time with JRC 2 comparing to JRC 1:
    ReportClientDocument#open(String, int);
    SubreportController#setTableLocation(String, ITable, ITable)
    DatabaseController#setTableLocation(ITable, ITable)
    Each invocation of one of these methods requires 2-4 seconds.
    Thank you in advance.
    Best regards
    Thomas
    (1) http://stackoverflow.com/questions/479405/replace-a-database-connection-for-subreports-with-jrc

    hello ....
    my report is  ''crystal report 11'' => "OLE DB"  => "Add Command(select * from table) " .
    code(JRC) : eclipse + crystal report for eclipse version 2 =>  "cr4e-all-in-one-win_2.0.1.zip"
    <%@ page contentType="text/html; charset=UTF-8"
    import="
    com.crystaldecisions.report.web.viewer.CrystalReportViewer,
    com.crystaldecisions.reports.sdk.ReportClientDocument,
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase,
    java.sql.Connection,
    java.sql.DriverManager,
    java.sql.ResultSet,
    java.sql.SQLException,
    java.sql.Statement" %>
    <%
         try {
              String reportName = "report.rpt";
              ReportClientDocument clientDoc = new ReportClientDocument();
              clientDoc.open(reportName, 0);
              String tableAlias = "Command";
              clientDoc.getDatabaseController().setDataSource(myResult("SELECT * FROM table"), tableAlias,tableAlias);
              CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();
              crystalReportPageViewer.setReportSource(clientDoc.getReportSource());
              crystalReportPageViewer.processHttpRequest(request, response, application, null);
         } catch (ReportSDKExceptionBase e) {
              e.printStackTrace();
             out.println(e);
    %>
    I simplified the code, *myResult("SELECT * FROM table") *  is absolutely no problem ,
    and this code is absolutely no problem in the "crystal report for eclipse "version 1
    but in  version 2 run error:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: u7121u6CD5u9810u671Fu7684u8CC7u6599u5EABu9023u7DDAu5668u932Fu8AA4---- Error code:-2147467259 Error code name:failed
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.new(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.b9.onDataSourceChanged(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setDataSource(Unknown Source)
         at org.apache.jsp.No_005f1.Eclipse_005fJTDS_005fSQL2005_005fTable_002dviewer_jsp._jspService(Eclipse_005fJTDS_005fSQL2005_005fTable_002dviewer_jsp.java:106)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.crystaldecisions.reports.common.QueryEngineException: u7121u6CD5u9810u671Fu7684u8CC7u6599u5EABu9023u7DDAu5668u932Fu8AA4
         at com.crystaldecisions.reports.queryengine.Connection.bf(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Rowset.z3(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Rowset.bL(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Rowset.zM(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Connection.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Table.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Table.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Table.try(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Table.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.Table.u7(Unknown Source)
         at com.crystaldecisions.reports.datafoundation.DataFoundation.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.dfadapter.CheckDatabaseHelper.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.datafoundation.CheckDatabaseCommand.new(Unknown Source)
         at com.crystaldecisions.reports.common.CommandManager.a(Unknown Source)
         at com.crystaldecisions.reports.common.Document.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.VerifyDatabaseCommand.new(Unknown Source)
         at com.crystaldecisions.reports.common.CommandManager.a(Unknown Source)
         at com.crystaldecisions.reports.common.Document.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.f.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.if(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)
         ... 39 more
    Please help me and tell me why....

  • Report program Performance problem

    Hi All,
       one object is taking 30hr for executing.some one develped this in 1998 but this time it is a big Performance problem.please some one helep what to do i am giving that code.
    *--DOCUMENTATION--
    Programe written by :  31.03.1998 .
    Purpose : this programe updates the car status into the table zsdtab1
    This programe is to be schedule in the backgroud periodically .
    Querries can be fired on the table zsdtab1 to get the details of the
        Car .
    This programe looks at the changes made in the material master from
    last updated date and the new entries in material master and updates
    the tables zsdtab1 .
    Changes in the Sales Order are not taken into account .
    To get a fresh data set the value of zupddate in table ZSTATUS as
    01.01.1998 . All the data will be refreshed from that date .
    Program Changed on 23/7/2001 after version upgrade 46b by jyoti
    Addition of New tables for Ibase
    tables used -
    tables : mara ,                        " Material master
             ausp ,                        " Characteristics table .
             zstatus ,                     " Last updated status table .
             zsdtab1 ,    " Central database table to be maintained .
             vbap ,                        " Sales order header table .
             vbak ,                        " Sales order item table .
             kna1 ,                        " Customer master .
             vbrk ,
             vbrp ,
             bkpf ,
             bseg ,
             mseg ,
             mkpf ,
             vbpa ,
             vbfa ,
             t005t .                         " Country details tabe .
    --NEW TABLES ADDEDFOR VERSION 4.6B--
    tables :   ibsymbol ,ibin , ibinvalues .
    data : vatinn like ibsymbol-atinn , vatwrt like ibsymbol-atwrt ,
           vatflv like ibsymbol-atflv .
    *--types definition--
    types : begin of mara_itab_type ,
               matnr like mara-matnr ,
               cuobf like mara-cuobf ,
            end of mara_itab_type ,
            begin of ausp_itab_type ,
               atinn like ausp-atinn ,
               atwrt like ausp-atwrt ,
               atflv like ausp-atflv ,
            end of ausp_itab_type .
    data : mara_itab type mara_itab_type occurs 500 with header line ,
           zsdtab1_itab like zsdtab1 occurs 500 with header line ,
           ausp_itab type ausp_itab_type occurs 500 with header line ,
           last_date type d ,
           date type d .
    data: length type i.
    clear mara_itab . refresh mara_itab .
    clear zsdtab1_itab . refresh zsdtab1_itab .
    select single  zupddate into last_date from zstatus
           where programm = 'ZSDDET01' .
    select matnr cuobf into (mara_itab-matnr , mara_itab-cuobf) from mara
          where mtart eq 'FERT' or mtart = 'ZCBU'.
        where MATNR IN MATERIA
         and ERSDA IN C_Date
         and MTART in M_TYP.
        append mara_itab .
    endselect .
    loop at mara_itab.
    clear zsdtab1_itab .
    zsdtab1_itab-commno = mara_itab-matnr .
       Get the detailed data into internal table ausp_itab .----------->>>
    clear ausp_itab . refresh ausp_itab .
    --change starts--
    select atinn atwrt atflv into (ausp_itab-atinn , ausp_itab-atwrt ,
                               ausp_itab-atflv) from ausp
          where objek = mara_itab-matnr .
          append ausp_itab .
       endselect .
       clear ausp_itab .
    select  atinn  atwrt atflv  into (ausp_itab-atinn , ausp_itab-atwrt ,
    ausp_itab-atflv) from ibin as a inner join ibinvalues as b
                      on ain_recno = bin_recno
           inner join  ibsymbol as c
                      on bsymbol_id = csymbol_id
        where a~instance = mara_itab-cuobf  .
      append ausp_itab .
    endselect .
    ----CHANGE ENDS HERE -
    sort ausp_itab by atwrt.
    loop at ausp_itab .
    clear date .
    case ausp_itab-atinn .
      when '0000000094' .
        zsdtab1_itab-model = ausp_itab-atwrt .  " model  .
      when '0000000101' .
        zsdtab1_itab-drive = ausp_itab-atwrt .  " drive
      when '0000000095' .
        zsdtab1_itab-converter = ausp_itab-atwrt . "converter
      when '0000000096' .
        zsdtab1_itab-transmssn = ausp_itab-atwrt . "transmission
      when '0000000097' .
        zsdtab1_itab-colour = ausp_itab-atwrt .    "colour
      when '0000000098' .
        zsdtab1_itab-ztrim = ausp_itab-atwrt .     "trim
      when '0000000103' .
    *=========Sujit 14-Mar-2006
       IF AUSP_ITAB-ATWRT(3) EQ 'WDB' OR AUSP_ITAB-ATWRT(3) EQ 'WDD'
       OR AUSP_ITAB-ATWRT(3) EQ 'WDC' OR AUSP_ITAB-ATWRT(3) EQ 'KPD'.
           ZSDTAB1_ITAB-CHASSIS_NO = AUSP_ITAB-ATWRT+3(14).
       ELSE.
           ZSDTAB1_ITAB-CHASSIS_NO = AUSP_ITAB-ATWRT .     "chassis no
       ENDIF.
        zsdtab1_itab-chassis_no = ausp_itab-atwrt .     "chassis no
    *=========14-Mar-2006
      when '0000000166' .
    ----25.05.04
      length = strlen( ausp_itab-atwrt ).
      if length < 15.                       "***aded by patil
       zsdtab1_itab-engine_no = ausp_itab-atwrt .     "ENGINE NO
      else.
    zsdtab1_itab-engine_no = ausp_itab-atwrt+13(14)."Aded on 21.05.04 patil
      endif.
    ----25.05.04
      when '0000000104' .
        zsdtab1_itab-body_no = ausp_itab-atwrt .     "BODY NO
      when '0000000173' .                                          "21.06.98
        zsdtab1_itab-cockpit = ausp_itab-atwrt .     "COCKPIT NO . "21.06.98
      when '0000000102' .
        zsdtab1_itab-dest = ausp_itab-atwrt .     "destination
      when '0000000105' .
        zsdtab1_itab-airbag = ausp_itab-atwrt .     "AIRBAG
      when '0000000110' .
        zsdtab1_itab-trailer_no = ausp_itab-atwrt .     "TRAILER_NO
      when '0000000109' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-fininspdat = date .   "FIN INSP DATE
      when '0000000108' .
        zsdtab1_itab-entrydate = ausp_itab-atwrt .     "ENTRY DATE
      when '0000000163' .
        zsdtab1_itab-regist_no = ausp_itab-atwrt .     "REGIST_NO
      when '0000000164' .
        zsdtab1_itab-mech_key = ausp_itab-atwrt .     "MECH_KEY
      when '0000000165' .
        zsdtab1_itab-side_ab_rt = ausp_itab-atwrt .     "SIDE_AB_RT
      when '0000000171' .
        zsdtab1_itab-side_ab_lt = ausp_itab-atwrt .     "SIDE_AB_LT
      when '0000000167' .
        zsdtab1_itab-elect_key = ausp_itab-atwrt .     "ELECT_KEY
      when '0000000168' .
        zsdtab1_itab-head_lamp = ausp_itab-atwrt .     "HEAD_LAMP
      when '0000000169' .
        zsdtab1_itab-tail_lamp = ausp_itab-atwrt .     "TAIL_LAMP
      when '0000000170' .
        zsdtab1_itab-vac_pump = ausp_itab-atwrt .     "VAC_PUMP
      when '0000000172' .
        zsdtab1_itab-sd_ab_sn_l = ausp_itab-atwrt .     "SD_AB_SN_L
      when '0000000174' .
        zsdtab1_itab-sd_ab_sn_r = ausp_itab-atwrt .     "SD_AB_SN_R
      when '0000000175' .
        zsdtab1_itab-asrhydunit = ausp_itab-atwrt .     "ASRHYDUNIT
      when '0000000176' .
        zsdtab1_itab-gearboxno = ausp_itab-atwrt .     "GEARBOXNO
      when '0000000177' .
        zsdtab1_itab-battery = ausp_itab-atwrt .     "BATTERY
      when '0000000178' .
        zsdtab1_itab-tyretype = ausp_itab-atwrt .     "TYRETYPE
      when '0000000179' .
        zsdtab1_itab-tyremake = ausp_itab-atwrt .     "TYREMAKE
      when '0000000180' .
        zsdtab1_itab-tyresize = ausp_itab-atwrt .     "TYRESIZE
      when '0000000181' .
        zsdtab1_itab-rr_axle_no = ausp_itab-atwrt .     "RR_AXLE_NO
      when '0000000183' .
        zsdtab1_itab-ff_axl_nor = ausp_itab-atwrt .     "FF_AXLE_NO_rt
      when '0000000182' .
        zsdtab1_itab-ff_axl_nol = ausp_itab-atwrt .     "FF_AXLE_NO_lt
      when '0000000184' .
        zsdtab1_itab-drivairbag = ausp_itab-atwrt .     "DRIVAIRBAG
      when '0000000185' .
        zsdtab1_itab-st_box_no = ausp_itab-atwrt .     "ST_BOX_NO
      when '0000000186' .
        zsdtab1_itab-transport = ausp_itab-atwrt .     "TRANSPORT
      when '0000000106' .
        zsdtab1_itab-trackstage = ausp_itab-atwrt .  " tracking stage
      when '0000000111' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_1 = date .    " tracking date for 1.
      when '0000000112' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_5 = date .    " tracking date for 5.
      when '0000000113' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_10 = date .   "tracking date for 10
      when '0000000114' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_15 = date .   "tracking date for 15
      when '0000000115' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_20 = date .   " tracking date for 20
      when '0000000116' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_25 = date .   " tracking date for 25
      when '0000000117' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_30 = date .   "tracking date for 30
      when '0000000118' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_35 = date .   "tracking date for 35
      when '0000000119' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_40 = date .   " tracking date for 40
      when '0000000120' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_45 = date .   " tracking date for 45
      when '0000000121' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_50 = date .   "tracking date for 50
      when '0000000122' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_55 = date .   "tracking date for 55
      when '0000000123' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_60 = date .   " tracking date for 60
      when '0000000124' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_65 = date .   " tracking date for 65
      when '0000000125' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_70 = date .   "tracking date for 70
      when '0000000126' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_75 = date .   "tracking date for 75
      when '0000000127' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_78 = date .   " tracking date for 78
      when '0000000203' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_79 = date .   " tracking date for 79
      when '0000000128' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_80 = date .   " tracking date for 80
      when '0000000129' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_85 = date .   "tracking date for 85
      when '0000000130' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_90 = date .   "tracking date for 90
      when '0000000131' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dat_trk_95 = date .   "tracking date for 95
      when '0000000132' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dattrk_100 = date .   " tracking date for100
      when '0000000133' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dattrk_110 = date .   " tracking date for110
      when '0000000134' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dattrk_115 = date .   "tracking date for 115
      when '0000000135' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dattrk_120 = date .   "tracking date for 120
      when '0000000136' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-dattrk_105 = date .   "tracking date for 105
      when '0000000137' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_1 = date .     "plan trk date for 1
      when '0000000138' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_5 = date .     "plan trk date for 5
      when '0000000139' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_10 = date .    "plan trk date for 10
      when '0000000140' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_15 = date .    "plan trk date for 15
      when '0000000141' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_20 = date .    "plan trk date for 20
      when '0000000142' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_25 = date .    "plan trk date for 25
      when '0000000143' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_30 = date .    "plan trk date for 30
      when '0000000144' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_35 = date .    "plan trk date for 35
      when '0000000145' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_40 = date .    "plan trk date for 40
      when '0000000146' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_45 = date .    "plan trk date for 45
      when '0000000147' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_50 = date .    "plan trk date for 50
      when '0000000148' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_55 = date .    "plan trk date for 55
      when '0000000149' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_60 = date .    "plan trk date for 60
      when '0000000150' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_65 = date .    "plan trk date for 65
      when '0000000151' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_70 = date .    "plan trk date for 70
      when '0000000152' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_75 = date .    "plan trk date for 75
      when '0000000153' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_78 = date .    "plan trk date for 78
      when '0000000202' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_79 = date .    "plan trk date for 79
      when '0000000154' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_80 = date .    "plan trk date for 80
      when '0000000155' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_85 = date .    "plan trk date for 85
      when '0000000156' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_90 = date .    "plan trk date for 90
      when '0000000157' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_95 = date .    "plan trk date for 95
      when '0000000158' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_100 = date .   "plan trk date for 100
      when '0000000159' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_105 = date .   "plan trk date for 105
      when '0000000160' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_110 = date .   "plan trk date for 110
      when '0000000161' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_115 = date .   "plan trk date for 115
      when '0000000162' .
        perform date_convert using  ausp_itab-atflv changing date .
        zsdtab1_itab-pdt_tk_120 = date .   "plan trk date for 120
    ********Additional fields / 24.05.98**********************************
      when '0000000099' .
        case ausp_itab-atwrt .
          when '540' .
            zsdtab1_itab-roll_blind = 'X' .
          when '482' .
            zsdtab1_itab-ground_clr = 'X' .
          when '551' .
            zsdtab1_itab-anti_theft = 'X' .
          when '882' .
            zsdtab1_itab-anti_tow = 'X' .
          when '656' .
            zsdtab1_itab-alloy_whel = 'X' .
          when '265' .
            zsdtab1_itab-del_class = 'X' .
          when '280' .
            zsdtab1_itab-str_wheel = 'X' .
          when 'CDC' .
            zsdtab1_itab-cd_changer = 'X' .
          when '205' .
            zsdtab1_itab-manual_eng = 'X' .
          when '273' .
            zsdtab1_itab-conn_handy = 'X' .
          when '343' .
            zsdtab1_itab-aircleaner = 'X' .
          when '481' .
            zsdtab1_itab-metal_sump = 'X' .
          when '533' .
            zsdtab1_itab-speaker = 'X' .
          when '570' .
            zsdtab1_itab-arm_rest = 'X' .
          when '580' .
            zsdtab1_itab-aircond = 'X' .
          when '611' .
            zsdtab1_itab-exit_light = 'X' .
          when '613' .
            zsdtab1_itab-headlamp = 'X' .
          when '877' .
            zsdtab1_itab-readlamp = 'X' .
          when '808' .
            zsdtab1_itab-code_ckd = 'X' .
          when '708' .
            zsdtab1_itab-del_prt_lc = 'X' .
          when '593' .
            zsdtab1_itab-ins_glass = 'X' .
          when '955' .
            zsdtab1_itab-zelcl = 'Elegance' .
          when '593' .
            zsdtab1_itab-zelcl = 'Classic' .
        endcase .
    endcase .
    endloop .
    *--Update the sales data .--
    perform get_sales_order using mara_itab-matnr .
    perform get_cartype using mara_itab-matnr .
    append zsdtab1_itab .
    endloop.
    <<<
    loop at zsdtab1_itab .
      if zsdtab1_itab-cartype <> 'W-203'
      or zsdtab1_itab-cartype <> 'W-210'
      or zsdtab1_itab-cartype <> 'W-211'.
          clear zsdtab1_itab-zelcl.
      endif.
    SELECT SINGLE * FROM ZSDTAB1 WHERE COMMNO = MARA_ITAB-MATNR .
    select single * from zsdtab1 where commno = zsdtab1_itab-commno.
    if sy-subrc <> 0 .
        insert into zsdtab1 values zsdtab1_itab .
    else .
        update zsdtab1 set :vbeln = zsdtab1_itab-vbeln
                       bill_doc = zsdtab1_itab-bill_doc
                       dest = zsdtab1_itab-dest
                       lgort = zsdtab1_itab-lgort
                       ship_tp = zsdtab1_itab-ship_tp
                       country = zsdtab1_itab-country
                       kunnr = zsdtab1_itab-kunnr
                       vkbur = zsdtab1_itab-vkbur
                       customer = zsdtab1_itab-customer
                       city   = zsdtab1_itab-city
                       region = zsdtab1_itab-region
                       model = zsdtab1_itab-model
                       drive = zsdtab1_itab-drive
                       converter = zsdtab1_itab-converter
                       transmssn = zsdtab1_itab-transmssn
                       colour = zsdtab1_itab-colour
                       ztrim = zsdtab1_itab-ztrim
                       commno = zsdtab1_itab-commno
                       trackstage = zsdtab1_itab-trackstage
                       chassis_no    =   zsdtab1_itab-chassis_no
                       engine_no     =   zsdtab1_itab-engine_no
                       body_no       =   zsdtab1_itab-body_no
                       cockpit       =   zsdtab1_itab-cockpit
                       airbag        =   zsdtab1_itab-airbag
                       trailer_no    =   zsdtab1_itab-trailer_no
                       fininspdat    =   zsdtab1_itab-fininspdat
                       entrydate     =   zsdtab1_itab-entrydate
                       regist_no     =   zsdtab1_itab-regist_no
                       mech_key      =   zsdtab1_itab-mech_key
                       side_ab_rt    =   zsdtab1_itab-side_ab_rt
                       side_ab_lt    =   zsdtab1_itab-side_ab_lt
                       elect_key     =   zsdtab1_itab-elect_key
                       head_lamp     =   zsdtab1_itab-head_lamp
                       tail_lamp     =   zsdtab1_itab-tail_lamp
                       vac_pump      =   zsdtab1_itab-vac_pump
                       sd_ab_sn_l    =   zsdtab1_itab-sd_ab_sn_l
                       sd_ab_sn_r    =   zsdtab1_itab-sd_ab_sn_r
                       asrhydunit    =   zsdtab1_itab-asrhydunit
                       gearboxno     =   zsdtab1_itab-gearboxno
                       battery       =   zsdtab1_itab-battery
                       tyretype      =   zsdtab1_itab-tyretype
                       tyremake      =   zsdtab1_itab-tyremake
                       tyresize      =   zsdtab1_itab-tyresize
                       rr_axle_no    =   zsdtab1_itab-rr_axle_no
                       ff_axl_nor    =   zsdtab1_itab-ff_axl_nor
                       ff_axl_nol    =   zsdtab1_itab-ff_axl_nol
                       drivairbag    =   zsdtab1_itab-drivairbag
                       st_box_no     =   zsdtab1_itab-st_box_no
                       transport     =   zsdtab1_itab-transport
    OPTIONS-
                       roll_blind    = zsdtab1_itab-roll_blind
                       ground_clr    = zsdtab1_itab-ground_clr
                       anti_theft    = zsdtab1_itab-anti_theft
                       anti_tow      = zsdtab1_itab-anti_tow
                       alloy_whel    = zsdtab1_itab-alloy_whel
                       del_class     = zsdtab1_itab-del_class
                       str_wheel     = zsdtab1_itab-str_wheel
                       cd_changer    = zsdtab1_itab-cd_changer
                       manual_eng    = zsdtab1_itab-manual_eng
                       conn_handy    = zsdtab1_itab-conn_handy
                       aircleaner    = zsdtab1_itab-aircleaner
                       metal_sump    = zsdtab1_itab-metal_sump
                       speaker       = zsdtab1_itab-speaker
                       arm_rest      = zsdtab1_itab-arm_rest
                       aircond       = zsdtab1_itab-aircond
                       exit_light    = zsdtab1_itab-exit_light
                       headlamp      = zsdtab1_itab-headlamp
                       readlamp      = zsdtab1_itab-readlamp
                       code_ckd      = zsdtab1_itab-code_ckd
                       del_prt_lc    = zsdtab1_itab-del_prt_lc
                       ins_glass     = zsdtab1_itab-ins_glass
                       dat_trk_1 = zsdtab1_itab-dat_trk_1
                       dat_trk_5 = zsdtab1_itab-dat_trk_5
                       dat_trk_10 = zsdtab1_itab-dat_trk_10
                       dat_trk_15 = zsdtab1_itab-dat_trk_15
                       dat_trk_20 = zsdtab1_itab-dat_trk_20
                       dat_trk_25 = zsdtab1_itab-dat_trk_25
                       dat_trk_30 = zsdtab1_itab-dat_trk_30
                       dat_trk_35 = zsdtab1_itab-dat_trk_35
                       dat_trk_40 = zsdtab1_itab-dat_trk_40
                       dat_trk_45 = zsdtab1_itab-dat_trk_45
                       dat_trk_50 = zsdtab1_itab-dat_trk_50
                       dat_trk_55 = zsdtab1_itab-dat_trk_55
                       dat_trk_60 = zsdtab1_itab-dat_trk_60
                       dat_trk_65 = zsdtab1_itab-dat_trk_65
                       dat_trk_70 = zsdtab1_itab-dat_trk_70
                       dat_trk_75 = zsdtab1_itab-dat_trk_75
                       dat_trk_78 = zsdtab1_itab-dat_trk_78
                       dat_trk_79 = zsdtab1_itab-dat_trk_79
                       dat_trk_80 = zsdtab1_itab-dat_trk_80
                       dat_trk_85 = zsdtab1_itab-dat_trk_85
                       dat_trk_90 = zsdtab1_itab-dat_trk_90
                       dat_trk_95 = zsdtab1_itab-dat_trk_95
                       dattrk_100 = zsdtab1_itab-dattrk_100
                       dattrk_105 = zsdtab1_itab-dattrk_105
                       dattrk_110 = zsdtab1_itab-dattrk_110
                       dattrk_115 = zsdtab1_itab-dattrk_115
                       dattrk_120 = zsdtab1_itab-dattrk_120
                       pdt_tk_1 = zsdtab1_itab-pdt_tk_1
                       pdt_tk_5 = zsdtab1_itab-pdt_tk_5
                       pdt_tk_10 = zsdtab1_itab-pdt_tk_10
                       pdt_tk_15 = zsdtab1_itab-pdt_tk_15
                       pdt_tk_20 = zsdtab1_itab-pdt_tk_20
                       pdt_tk_25 = zsdtab1_itab-pdt_tk_25
                       pdt_tk_30 = zsdtab1_itab-pdt_tk_30
                       pdt_tk_35 = zsdtab1_itab-pdt_tk_35
                       pdt_tk_40 = zsdtab1_itab-pdt_tk_40
                       pdt_tk_45 = zsdtab1_itab-pdt_tk_45
                       pdt_tk_50 = zsdtab1_itab-pdt_tk_50
                       pdt_tk_55 = zsdtab1_itab-pdt_tk_55
                       pdt_tk_60 = zsdtab1_itab-pdt_tk_60
                       pdt_tk_65 = zsdtab1_itab-pdt_tk_65
                       pdt_tk_70 = zsdtab1_itab-pdt_tk_70
                       pdt_tk_75 = zsdtab1_itab-pdt_tk_75
                       pdt_tk_78 = zsdtab1_itab-pdt_tk_78
                       pdt_tk_79 = zsdtab1_itab-pdt_tk_79
                       pdt_tk_80 = zsdtab1_itab-pdt_tk_80
                       pdt_tk_85 = zsdtab1_itab-pdt_tk_85
                       pdt_tk_90 = zsdtab1_itab-pdt_tk_90
                       pdt_tk_95 = zsdtab1_itab-pdt_tk_95
                       pdt_tk_100 = zsdtab1_itab-pdt_tk_100
                       pdt_tk_105 = zsdtab1_itab-pdt_tk_105
                       pdt_tk_110 = zsdtab1_itab-pdt_tk_110
                       pdt_tk_115 = zsdtab1_itab-pdt_tk_115
                       pdt_tk_120 = zsdtab1_itab-pdt_tk_120
                       cartype = zsdtab1_itab-cartype
                       zelcl = zsdtab1_itab-zelcl
                       excise_no = zsdtab1_itab-excise_no
    where commno = zsdtab1_itab-commno .
       Update table .---------<<<
    endif .
    endloop .
    perform update_excise_date .
    perform update_post_goods_issue_date .
    perform update_time.
    *///////////////////// end of programe /////////////////////////////////
    Get sales data -
    form get_sales_order using matnr .
      data : corr_vbeln like vbrk-vbeln .
    ADDED BY ADITYA / 22.06.98 **************************************
    perform get_order using matnr .
    select single vbeln lgort into (zsdtab1_itab-vbeln , zsdtab1_itab-lgort)
                from vbap where matnr = matnr .   " C-22.06.98
                  from vbap where vbeln = zsdtab1_itab-vbeln .
      if sy-subrc = 0 .
    ************Get the Excise No from Allocation Field*******************
        select single * from zsdtab1 where commno = matnr .
        if zsdtab1-excise_no =  '' .
          select * from vbrp where matnr = matnr .
            select single vbeln into corr_vbeln from vbrk where
            vbeln = vbrp-vbeln and vbtyp = 'M'.
            if sy-subrc eq 0.
              select single * from vbrk where vbtyp = 'N'
              and sfakn = corr_vbeln.      "cancelled doc.
              if sy-subrc ne 0.
                select single * from vbrk where vbeln = corr_vbeln.
                if sy-subrc eq 0.
                  data : year(4) .
                  move sy-datum+0(4) to year .
      select single * from bkpf where awtyp = 'VBRK' and awkey = vbrk-vbeln
                                      and  bukrs = 'MBIL' and gjahr = year .
                  if sy-subrc = 0 .
      select single * from bseg where bukrs = 'MBIL' and belnr = bkpf-belnr
                                       and gjahr = year and koart = 'D' and
                                                               shkzg = 'S' .
                    zsdtab1_itab-excise_no = bseg-zuonr .
                  endif .
                endif.
              endif.
            endif.
          endselect.
        endif .
        select single kunnr vkbur into (zsdtab1_itab-kunnr ,
                zsdtab1_itab-vkbur) from vbak
                where vbeln = zsdtab1_itab-vbeln .
        if sy-subrc = 0 .
          select single name1 ort01 regio into (zsdtab1_itab-customer ,
             zsdtab1_itab-city , zsdtab1_itab-region) from kna1
             where kunnr = zsdtab1_itab-kunnr .
        endif.
      Get Ship to Party **************************************************
        select single * from vbpa where vbeln = zsdtab1_itab-vbeln and
                        parvw = 'WE' .
        if sy-subrc = 0 .
            zsdtab1_itab-ship_tp = vbpa-kunnr .
      Get Destination Country of Ship to Party .************
            select single * from kna1 where kunnr = vbpa-kunnr .
            if sy-subrc = 0 .
               select single * from t005t where land1 = kna1-land1
                                       and spras = 'E' .
               if sy-subrc = 0 .
                   zsdtab1_itab-country = t005t-landx .
               endif .
            endif .
        endif .
      endif .
    endform.                               " GET_SALES
    form update_time.
      update zstatus set zupddate = sy-datum
                         uzeit = sy-uzeit
      where programm = 'ZSDDET01' .
    endform.                               " UPDATE_TIME
    *&      Form  DATE_CONVERT
    form date_convert using atflv changing date .
      data : dt(8) , dat type i .
      dat = atflv .
      dt = dat .
      date = dt .
    endform.                               " DATE_CONVERT
    *&      Form  UPDATE_POST_GOODS_ISSUE_DATE
    form update_post_goods_issue_date .
      types : begin of itab1_type ,
                mblnr like mseg-mblnr ,
                budat like mkpf-budat ,
              end of itab1_type .
      data : itab1 type itab1_type occurs 10 with header line .
      loop at mara_itab .
        select single * from zsdtab1 where commno = mara_itab-matnr .
        if sy-subrc =  0  and zsdtab1-postdate =  '00000000' .
          refresh itab1 . clear itab1 .
        select * from mseg where matnr = mara_itab-matnr and bwart = '601' .
            itab1-mblnr = mseg-mblnr .
            append itab1 .
          endselect .
          loop at itab1 .
            select single * from mkpf where mblnr = itab1-mblnr .
            if sy-subrc = 0 .
              itab1-budat = mkpf-budat .
              modify itab1 .
            endif .
          endloop .
          sort itab1 by budat .
          read table itab1 index 1 .
          if sy-subrc = 0 .
            update zsdtab1 set postdate = itab1-budat
                         where commno = mara_itab-matnr .
          endif .
        endif .
      endloop .
    endform.                               " UPDATE_POST_GOODS_ISSUE_DATE
    *&      Form  UPDATE_EXCISE_DATE
    form update_excise_date.
      types : begin of itab2_type ,
                mblnr like mseg-mblnr ,
                budat like mkpf-budat ,
              end of itab2_type .
      data : itab2 type itab2_type occurs 10 with header line .
      loop at mara_itab .
        select single * from zsdtab1 where commno = mara_itab-matnr .
        if sy-subrc =  0  and zsdtab1-excise_dat  = '00000000' .
          refresh itab2 . clear itab2 .
          select * from mseg where matnr = mara_itab-matnr and
                                  (  bwart = '601' or  bwart = '311' ) .
            itab2-mblnr = mseg-mblnr .
            append itab2 .
          endselect .
          loop at itab2 .
            select single * from mkpf where mblnr = itab2-mblnr .
            if sy-subrc = 0 .
              itab2-budat = mkpf-budat .
              modify itab2 .
            endif .
          endloop .
          sort itab2 by budat .
          read table itab2 index 1 .
          if sy-subrc = 0 .
            update zsdtab1 set excise_dat = itab2-budat
                         where commno = mara_itab-matnr .
          endif .
        endif .
      endloop .
    endform.                               " UPDATE_EXCISE_DATE
    form get_order using matnr .
    types :  begin of itab_type ,
                vbeln like vbap-vbeln ,
                posnr like vbap-posnr ,
             end of itab_type .
    data : itab type itab_type occurs 10 with header line .
    refresh itab . clear itab .
    select * from vbap where matnr = mara_itab-matnr .
       itab-vbeln = vbap-vbeln .
       itab-posnr = vbap-posnr .
       append itab .
    endselect .
    loop at itab .
      select single * from vbak where vbeln = itab-vbeln .
      if vbak-vbtyp <> 'C' .
        delete itab .
      endif .
    endloop .
    loop at itab .
    select single * from vbfa where vbelv = itab-vbeln and
             posnv = itab-posnr and vbtyp_n = 'H' .
    if sy-subrc = 0 .
      delete itab .
    endif .
    endloop .
    clear :  zsdtab1_itab-vbeln ,  zsdtab1_itab-bill_doc .
    loop at itab .
      zsdtab1_itab-vbeln = itab-vbeln .
      select single * from vbfa where vbelv = itab-vbeln and
             posnv = itab-posnr and vbtyp_n = 'M' .
    if sy-subrc = 0 .
      zsdtab1_itab-bill_doc = vbfa-vbeln .
    endif .
    endloop .
    endform .
    *&      Form  GET_CARTYPE
    form get_cartype using matnr .
    select single * from mara where matnr = matnr .
    zsdtab1_itab-cartype = mara-satnr .
    endform.                    " GET_CARTYPE

    Hi,
    I have analysed your program and i would like to share following points for better performance of this report :
    (a)  Use the field Names instead of Select * or Select Single * as if you use the field names it will consume less amount of resources inside the loop as well as you have lot many Select Single * and u r using very big tables like VBAP and many more.
    (b) Trace on ST05 which particular query is mostly effecting your system or use ST12 in current mode to trace for less inputs which run the report for 20-30 min so that we get an idea which queries are effecting the system and taking a lot of time.
    (c) In Case of internal tables sort the data properly and use binary search for getting the data.
    I think this will help.
    Thanks and Regards,
    Harsh

  • Performance problems with XMLTABLE and XMLQUERY involving relational data

    Hello-
    Is anyone out there using XMLTABLE or XMLQUERY with more than a toy set of data? I am running into serious performance problems tyring to do basic things such as:
    * Combine records in 10 relational tables into a single table of XMLTYPE records using XMLTABLE. This hangs indefinitely for any more than 800 records. Oracle has confirmed that this is a problem and is working on a fix.
    * Combine a single XMLTYPE record with several relational code tables into a single XMLTYPE record using XMLQUERY and ora:view() to insert code descriptions after each code. Performance is 10 seconds for 10 records (terrible) passing a batch of records , or 160 seconds for one record (unacceptable!). How can it take 10 times longer to process 1/10th the number of records? Ironically, the query plan says it will do a full table scan of records for the batch, but an index access for the one record passed to the XMLQUERY.
    I am rapidly losing faith in XML DB, and desparately need some hints on how to work around these performance problems, or at least some assurance that others have been able to get this thing to perform.

    <Note>Long post, sorry.</Note>
    First, thanks for the responses above. I'm impressed with the quality of thought put into them. (Do the forum rules allow me to offer rewards? :) One suggestion in particular made a big performance improvement, and I’m encouraged to hear of good performance in pure XML situations. Unfortunately, I think there is a real performance challenge in two use cases that are pertinent to the XML+relational subject of this post and probably increasingly common as XML DB usage increases:
    •     Converting legacy tabular data into XML records; and
    •     Performing code table lookups for coded values in XML records.
    There are three things I want to accomplish with this post:
    •     Clarify what we are trying to accomplish, which might expose completely different approaches than I have tried
    •     Let you know what I tried so far and the rationale for my approach to help expose flaws in my thinking and share what I have learned
    •     Highlight remaining performance issues in hopes that we can solve them
    What we are trying to accomplish:
    •     Receive a monthly feed of 10,000 XML records (batched together in text files), each containing information about an employee, including elements that repeat for every year of service. We may need to process an annual feed of 1,000,000 XML records in the future.
    •     Receive a one-time feed of 500,000 employee records stored in about 10 relational tables, with a maximum join depth of 2 or 3. This is inherently a relational-to-XML process. One record/second is minimally acceptable, but 10 records/sec would be better.
    •     Consolidate a few records (from different providers) for each employee into a single record. Given the data volume, we need to achieve a minimum rate of 10 records per second. This may be an XML-only process, or XML+relational if code lookups are done during consolidation.
    •     Allow the records to be viewed and edited, with codes resolved into user-friendly descriptions. Since a user is sitting there, code lookups done when a record is viewed (vs. during consolidation) should not take more than 3 seconds total. We have about 20 code tables averaging a few hundred rows each, though one has 450,000 rows.
    As requested earlier, I have included code at the end of this post for example tables and queries that accurately (but simply) replicate our real system.
    Why we did and why:
    •     Stored the source XML records as CLOBS: We did this to preserve the records exactly as they were certified and sent from providers. In addition, we always access the entire XML record as a whole (e.g., when viewing a record or consolidating employee records), so this storage model seemed like a good fit. We can copy them into another format if necessary.
    •     Stored the consolidated XML employee records as “binary XML”. We did this because we almost always access a single, entire record as a whole (for view/edit), but might want to create some summary statistics at some point. Binary XML seemed the best fit.
    •     Used ora:view() for both tabular source records and lookup tables. We are not aware of any alternatives at this time. If it made sense, most code tables could be pre-converted into XML documents, but this seemed risky from a performance standpoint because the lookups use both code and date range constraints (the meaning of codes changes over time).
    •     Stored records as XMLTYPE columns in a table with other key columns on the table, plus an XMLTYPE metadata column. We thought this would facilitate pulling a single record (or a few records for a given employee) quickly. We knew this might be unnecessary given XML indexes and virtual columns, but were not experienced with those and wanted the comfort of traditional keys. We did not used XMLTYPE tables or the XML Repository for documents.
    •     Used XMLTABLE to consolidate XML records by looping over each distinct employee ID in the source batch. We also tried XMLQUERY and it seems to perform about the same. We can achieve 10 to 20 records/second if we do not do any code lookups during consolidation, just meeting our performance requirement, but still much slower than expected.
    •     Used PL/SQL with XMLFOREST to convert tabular source records to XML by looping over distinct employee IDs. We tried this outside PL/SQL both with XMLFOREST and XMLTABLE+ora:view(), but it hangs in both cases for more than 800 records (a known/open issue). We were able to get it to work by using an explicit cursor to loop over distinct employee IDs (rather than processing all records at once within the query). The performance is one record/second, which is minimally acceptable and interferes with other database activity.
    •     Used XMLQUERY plus ora:view() plus XPATH constraints to perform code lookups. When passing a single employee record, the response time ranges from 1 sec to 160 sec depending on the length of the record (i.e., number of years of service). We achieved a 5-fold speedup using an XMLINDEX (thank you Marco!!). The result may be minimally acceptable, but I’m baffled why the index would be needed when processing a single XML record. Other things we tried: joining code tables in the FOR...WHERE clauses, joining code tables using LET with XPATH constraints and LET with WHERE clause constraints, and looking up codes individually via JDBC from the application code at presentation time. All those approaches were slower. Note: the difference I mentioned above in equality/inequality constraint performance was due to data record variations not query plan variations.
    What issues remain?
    We have a minimally acceptable solution from a performance standpoint with one very awkward PL/SQL workaround. The performance of a mixed XML+relational data query is still marginal IMHO, until we properly utilize available optimizations, fix known problems, and perhaps get some new query optimizations. On the last point, I think the query plan for tabular lookups of codes in XML records is falling short right now. I’m reminded of data warehousing in the days before hash joins and star join optimization. I would be happy to be wrong, and just as happy for viable workarounds if I am right!
    Here are the details on our code lookup challenge. Additional suggestions would be greatly appreciated. I’ll try to post more detail on the legacy table conversion challenge later.
    -- The main record table:
    create table RECORDS (
    SSN varchar2(20),
    XMLREC sys.xmltype
    xmltype column XMLREC store as binary xml;
    create index records_ssn on records(ssn);
    -- A dozen code tables represented by one like this:
    create table CODES (
    CODE varchar2(4),
    DESCRIPTION varchar2(500)
    create index codes_code on codes(code);
    -- Some XML records with coded values (the real records are much more complex of course):
    -- I think this took about a minute or two
    DECLARE
    ssn varchar2(20);
    xmlrec xmltype;
    i integer;
    BEGIN
    xmlrec := xmltype('<?xml version="1.0"?>
    <Root>
    <Id>123456789</Id>
    <Element>
    <Subelement1><Code>11</Code></Subelement1>
    <Subelement2><Code>21</Code></Subelement2>
    <Subelement3><Code>31</Code></Subelement3>
    </Element>
    <Element>
    <Subelement1><Code>11</Code></Subelement1>
    <Subelement2><Code>21</Code></Subelement2>
    <Subelement3><Code>31</Code></Subelement3>
    </Element>
    <Element>
    <Subelement1><Code>11</Code></Subelement1>
    <Subelement2><Code>21</Code></Subelement2>
    <Subelement3><Code>31</Code></Subelement3>
    </Element>
    </Root>
    for i IN 1..100000 loop
    insert into records(ssn, xmlrec) values (i, xmlrec);
    end loop;
    commit;
    END;
    -- Some code data like this (ignoring date ranges on codes):
    DECLARE
    description varchar2(100);
    i integer;
    BEGIN
    description := 'This is the code description ';
    for i IN 1..3000 loop
    insert into codes(code, description) values (to_char(i), description);
    end loop;
    commit;
    end;
    -- Retrieve one record while performing code lookups. Takes about 5-6 seconds...pretty slow.
    -- Each additional lookup (times 3 repeating elements in the data) adds about 1 second.
    -- A typical real record has 5 Elements and 20 Subelements, meaning more than 20 seconds to display the record
    -- Note we are accessing a single XML record based on SSN
    -- Note also we are reusing the one test code table multiple times for convenience of this test
    select xmlquery('
    for $r in Root
    return
    <Root>
    <Id>123456789</Id>
    {for $e in $r/Element
        return
        <Element>
          <Subelement1>
            {$e/Subelement1/Code}
    <Description>
    {ora:view("disaac","codes")/ROW[CODE=$e/Subelement1/Code]/DESCRIPTION/text() }
    </Description>
    </Subelement1>
    <Subelement2>
    {$e/Subelement2/Code}
    <Description>
    {ora:view("disaac","codes")/ROW[CODE=$e/Subelement2/Code]/DESCRIPTION/text()}
    </Description>
    </Subelement2>
    <Subelement3>
    {$e/Subelement3/Code}
    <Description>
    {ora:view("disaac","codes")/ROW[CODE=$e/Subelement3/Code]/DESCRIPTION/text() }
    </Description>
    </Subelement3>
    </Element>
    </Root>
    ' passing xmlrec returning content)
    from records
    where ssn = '10000';
    The plan shows the nested loop access that slows things down.
    By contrast, a functionally-similar SQL query on relational data will use a hash join and perform 10x to 100x faster, even for a single record. There seems to be no way for the optimizer to see the regularity in the XML structure and perform a corresponding optimization in joining the code tables. Not sure if registering a schema would help. Using structured storage probably would. But should that be necessary given we’re working with a single record?
    Operation Object
    |SELECT STATEMENT ()
    | SORT (AGGREGATE)
    | NESTED LOOPS (SEMI)
    | TABLE ACCESS (FULL) CODES
    | XPATH EVALUATION ()
    | SORT (AGGREGATE)
    | NESTED LOOPS (SEMI)
    | TABLE ACCESS (FULL) CODES
    | XPATH EVALUATION ()
    | SORT (AGGREGATE)
    | NESTED LOOPS (SEMI)
    | TABLE ACCESS (FULL) CODES
    | XPATH EVALUATION ()
    | SORT (AGGREGATE)
    | XPATH EVALUATION ()
    | SORT (AGGREGATE)
    | XPATH EVALUATION ()
    | TABLE ACCESS (BY INDEX ROWID) RECORDS
    | INDEX (RANGE SCAN) RECORDS_SSN
    With an xmlindex, the same query above runs in about 1 second, so is about 5x faster (0.2 sec/lookup), which is almost good enough. Is this the answer? Or is there a better way? I’m not sure why the optimizer wants to scan the code tables and index into the (one) XML record, rather than the other way around, but maybe that makes sense if the optimizer wants to use the same general plan as when the WHERE clause constraint is relaxed to multiple records.
    -- Add an xmlindex. Takes about 2.5 minutes
    create index records_record_xml ON records(xmlrec)
    indextype IS xdb.xmlindex;
    Operation Object
    |SELECT STATEMENT ()
    | SORT (GROUP BY)
    | FILTER ()
    | NESTED LOOPS ()
    | FAST DUAL ()
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | SORT (AGGREGATE)
    | FILTER ()
    | TABLE ACCESS (FULL) CODES
    | FILTER ()
    | NESTED LOOPS ()
    | FAST DUAL ()
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | SORT (GROUP BY)
    | FILTER ()
    | NESTED LOOPS ()
    | FAST DUAL ()
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | SORT (AGGREGATE)
    | FILTER ()
    | TABLE ACCESS (FULL) CODES
    | FILTER ()
    | NESTED LOOPS ()
    | FAST DUAL ()
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | SORT (GROUP BY)
    | FILTER ()
    | NESTED LOOPS ()
    | FAST DUAL ()
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | SORT (AGGREGATE)
    | FILTER ()
    | TABLE ACCESS (FULL) CODES
    | FILTER ()
    | NESTED LOOPS ()
    | FAST DUAL ()
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | SORT (AGGREGATE)
    | FILTER ()
    | NESTED LOOPS ()
    | FAST DUAL ()
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | SORT (AGGREGATE)
    | TABLE ACCESS (BY INDEX ROWID) SYS113473_RECORDS_R_PATH_TABLE
    | INDEX (RANGE SCAN) SYS113473_RECORDS_R_PATHID_IX
    | TABLE ACCESS (BY INDEX ROWID) RECORDS
    | INDEX (RANGE SCAN) RECORDS_SSN
    Am I on the right path, or am I totally using the wrong approach? I thought about using XSLT but was unsure how to reference the code tables.
    I’ve done the best I can constraining the main record to a single row passed to the XMLQUERY. Given Mark’s post (thanks!) should I be joining and constraining the code tables in the SQL WHERE clause too? That’s going to make the query much more complicated, but right now we’re more concerned about performance than complexity.

  • LR3 "Extra Processing in Develop" Performance Problem

    I have been investigating a specific LR3 performance problem.  It may explain a small subset of the problems people have reported in the "Why is LR3 So Slow?" thread.   I'm starting this thread to focus on this particular problem.  I hope others will confirm/refute/refine my findings.
    The Problem
    In Develop, when I make an adjustment, normally the following happens: The CPU usage (as shown in Activity Monitor's bar graph) jumps to between 50 and 75% for all four cores, the updated image appears, and the CPU usage settles back down.  This all happens in less than half a second.  Note: this is with the image at the Fit size.  However, sometimes I instead get the following after an adjustment: the CPU usage jumps to 50 to 75% for all four cores and the updated image appears as usual, however, instead of settling back down, the CPU usage jumps up to 90 to 100% for all cores and stays there for 3 to 5 seconds before settling down. Thus it appears that LR is doing some kind of "extra processing" since a lot of computation is happening AFTER the updated image has already appeared.  I will refer to this problem as "EP".  Obviously, when you are getting EP, editing in Develop becomes very balky.
    Dependency on ratio between image size and displayed size
    It appears that EP only happens when the displayed size of the image (in Fit zoom level and perhaps also Fill zoom level) is above a certain percentage of the actual image size (as currently cropped).  Evidence: When editing full 21MP 5D2 images, I don't experience EP.  If I crop the 5D2 image fairly significantly, then I can get EP.  When editing 10MP images from my Canon S90, I usually get EP for landscape orientation pictures but not for portrait orientation pictures (since in Fit mode, landscape images display at a higher zoom level than portrait images).  If I am getting EP, I can eliminate it by sufficiently reducing the size that LR is displaying the image by resizing the LR window smaller, opening additional panels (I normally edit with only the right panel open), displaying the toolbar, etc.  It appears that EP is enabled when the displayed image is about 50% or larger w.r.t. the actual image (as currently cropped).  For example, EP becomes enabled when a 3648 pixel wide S90 image is displayed at least 17 and 7/8 inches wide on my 100 ppi monitor (i.e. about 1787 pixels).
    Dependency on HOW an adjustment is invoked
    Even when the displayed image size is large enough w.r.t. the actual image size to enable EP, whether you get it on a given adjustment depends on how you invoke it:
    - If you CLICK (i.e. press the mouse button down and quickly release it) on the track of one of the sliders (a technique I use often to make big jumps), EP will happen.
    - If you press the mouse button down on a slider handle, drag it to a new position, and quickly release the mouse button), EP will happen
    - If you press the mouse button down on a slider handle, drag it to a new position, but continue to hold the mouse button down until the displayed image is updated, EP does NOT happen (either before or after you then release the mouse button).
    - If you highlight the numeric field at the end of a slider and use the arrow keys (possibly along with Shift) to increment or decrement the value, EP does NOT happen.
    - EP will happen if you resize the LR window such that the displayed image size is above the threshold.  (In fact, I determined the threshold by making a series of window width increases until I saw EP indicated by the CPU bar graphs.)
    - EP can happen with local adjustment brush applications, but as with the sliders, it depends on HOW you perform the brush stroke.  Single click and drags with immediate mouse release cause EP, drags with delayed mouse button release don't.
    - Clicking an earlier History state causes EP
    - More exploration could be done.  For example, I haven't looked at Graduated Filter and Spot Removal adjustments.
    My theory of what's happening
    With LR2, my understanding is that in Develop mode when the displayed image is below 1:1 zoom level, after an adjustment is invoked, LR calculates the new version of the image to display using a fast, simplified algorithm that doesn't include the more computationally intensive adjustments like Sharpening and Noise Reduction (and perhaps works on a lower rez version of the image with multiple sensels binned together?).  It appears that in conditions described above, LR3 calculates the initial, fast image update and then goes on to do the full update of the image, including the computationally intensive adjustments.  Evidence:   setting Sharpening Amount and Luminance and Color Noise Reduction to zero eliminates EP (or reduces the amount of time it takes to be barely noticeable).  I'm not sure whether the displayed image is updated with the results of the extra processing.  I think the answer is Yes since when I tried an adjustment of changing Sharpening Amount from 0 to 90, the initial update of the displayed image showed sharpening but after the EP, the displayed image was updated again to show somewhat different sharpening. Perhaps Adobe felt that it would be useful to see the more accurate version of the image when it is at or above 50% zoom.  Maybe the UI is supposed to cancel the EP if you start to make another adjustment before it has completed but the canceling doesn't happen unless you invoke the adjustment in one of the ways described above that doesn't cause EP.  
    Misc
    - EP doesn't seem to happen for Process 2003
    - As others have mentioned, I'm surprised that LR (both version 2 and 3) in 64bit mode doesn't use more available RAM.  I don't think I've seen LR go above 4GB of virtual memory or above 3GB "Real Memory" (as reported by Activity Monitor) even though I have several GB free.
    - It should be obvious from the above that if you experience EP, there are workarounds: reduce the size of the displayed image (e.g. by window resizing), invoke adjustments in ways that don't cause EP, turn off Sharpening and Noise Reduction until the end of editing an image.
    System specs
    First generation Intel Mac Pro with two dual-core CPUs at 2.66 Ghz
    OS 10.5.8
    21GB RAM
    ACR cache on volume striped across 3 internal SATA drives
    LR catalog and RAWs on an internal SATA drive
    30" HP LP3065 monitor (2560 pixels wide)
    NVIDIA GeForce 7300 GT

    I'm impressed by your thorough analysis.
    Clearly, the programmers haven't figured out the best way to do intelligent caching and/or parallel rendering at a reduced size yet.
    In my experience reducing the settings in the "Details" panel doesn't help.
    What really bugs me is that the lag (or increasing lack of interactiveness) depends on the number of adjustments one has made.
    This shouldn't be the case. If a cache is produced then every further adjustment should only cost the effort for that latest adjustment and not include adjustments before it. There are things that stand in the way of straightforward edit applications:
    If you work below 1:1 preview, adjustments have to be shown in a reduced form. If you don't have a way to faithfully mimic the adjustments on the reduced size, you have to do them on the original image and then scale down. That's expensive.
    To the best of my knowledge LR uses a fixed image pipeline. Hence, independently of the order in which you apply edits, they are always performed in the same fixed order. Say all spot removal operations are done first. If you have a lot of adjustment brush edits and then add a spot removal operation, it means that all the adjustment brush operations have to be replayed each time you do a little adjustment on your spot removal edit.
    I believe what you are seeing is mostly related to 1.
    I also believe that the way LR currently handles a moderate number of edits is unacceptable and incompatible with the notion that it is usable in a commercial setting for more than trivial edits. I suspect there is something else going on. If everyone saw the deterioration in performance after a number of edits that I see, I don't think LR would be as accepted as it is. Having said that, I've read that the problem of repeated applications of the adjustment brush slowing LR down has existed for a long time. I truly hope that this doesn't mean we'll have to live for it for the foreseeable future.
    There are two ways I can see how 2. should be addressed:
    combine the effects of a set of operations into one bitmap operation. Instead of replaying all adjustment brush strokes one after the other (speedwise it feels like this is happening), compute a single bitmap operation that combines all effects.
    give up the idea that there is an image pipeline with a fixed execution order.
    Some might argue that the second point is at odds with the whole idea of parametric editing, but I dispute that. Either edit operations are commutable in which case the order is immaterial, or they are not. If they are not, the user applies the edits in a way as he/she sees fit and will thus compensate for any effect of a changed ordering.
    N.B., currently the doctrine of "fixed ordering of edit applications" results in the effect that even if you convert an image into B&W all your adjustment brush edits that applied colour tints will still show through. Reasoning: The user should be able to locally tint a B&W image. I agree with the latter but this could be achieved by only applying those tinting brush strokes that were created after the B&W conversion. All the ones that happened before should only be used to obtain the correct luminance values for the B&W conversion but obviously they shouldn't cause tinted areas.
    The above example demonstrates to me that users naturally expect operations to occurr in the order they have been introduced, not in a fixed predefined order. If that principle were followed, I see no reason why the speed of a single edit should depend on the number of edits that were done to the image before.
    I hope the programmers can (and the management wants to) address the performance issues. While I find LR usable for pretty modest edits, in no way the performance on my system approaches that would I would expect from an industrial strenght application.
    P.S.: Your message reminded me of the following: When I experience serious lag with LR showing the strokes I make with an adjustment brush, it helps to pause a moment after the first click before one starts moving. This allows LR to catch up and then one can see the effect of the application pretty much interactively. Otherwise, there is terrible lag and the feedback where you have brushed an effect comes way too late.

  • Serious performance problem - SELECT DISTINCT x.JDOCLASSX FROM x

    I am noticing a huge performance problem when trying to access a member that
    is lazily loaded:
    MonitorStatus previousStatus = m.getStatus();
    This causes the following query to be executed:
    SELECT DISTINCT MONITORSTATUSX.JDOCLASSX FROM MONITORSTATUSX
    This table has 3 million records and this SQL statement takes 3 minutes to
    execute! Even worse, my app heavily uses threads, so this statement is
    executed in each of the 32 threads. As a result the application stops.
    Is there any way that I can optimize this? And more importantly, can Kodo
    handle a multithreaded app like this with a huge database? I've been having
    a lot of performance problems since I've started doing stress & load
    testing, and I'm thinking Kodo isn't ready for this type of application.
    Thanks,
    Michael

    You can prevent this from happening by explicitly enumerating the valid
    persistent types in a property. See
    http://docs.solarmetric.com/manual.html#com.solarmetric.kodo.PersistentTypes
    for details.
    >
    Inconveniently, this nugget of performance info is not listed in the
    optimization guide. I'll add in an entry for it.This setting did in fact prevent the query from running which fixed the
    problem. It definitely belongs in the optimization guide.
    And more importantly, can Kodo
    handle a multithreaded app like this with a huge database? I've beenhaving
    a lot of performance problems since I've started doing stress & load
    testing, and I'm thinking Kodo isn't ready for this type of application.I'd like to find out more information about details about your issues. We
    do a decent amount of stress / load testing internally, but there are
    always use cases that we don't test. Please send me an email (I'm assuming
    that [email protected] is not really your address) and let's
    figure out some way to do an analysis of what you're seeing.This email is just for posting to usenet, to avoid spam. I'm now running my
    app through stress/load testing so I hope to discover any remaining issues
    before going into production. As of this morning the system seems to be
    performing quite well. Now the biggest performance problem for me is the
    lack of what I think is called "outer join". I know you'll have this in 3.0
    but I'm suprised you don't have this already because not having it really
    affects performance. I already had to code one query by hand with JDBC due
    to this. It was taking 15+ minutes with Kodo and with my JDBC version it
    only takes a few seconds. There are lots of anti-JDO people and performance
    issues like this really give them ammunition. Overall I just have the
    impression that Kodo hasn't been used on many really large scale projects
    with databases that have millions of records.
    Thanks for configuration fix,
    Michael

  • Performance Problems with Web Layouts in web interface

    Hello Gurus,
    We have a a BPS web interface tool which has the following design:
    1> A web interface with several tabs
    2> Each tab has around 3-4 input layouts which are dependent on each other
    3> In all there are 120-140 layouts that the tool uses...
    My questions were in term of performance
    1> Is there a limit to how many web layouts you can use per page/tab/view or if SAP recommends specific number of web layouts per page/tab/view ?
    2> If there is a limitation...our intention was to convert all the display layouts into BW reports so as to increase the performance of the tool....
    3> Would like to know the restriction on the number of users who can log into the tool as a specific point of time ? We may have 50-60 minimum using this tool.
    I would appreciate your help in this regard.
    Thanks in advance

    Hello Rashmi,
    Have you got a chance to look at the performance guide and SAP notes on BPS performance. If not here are the details
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/performance guide - sap sem bw bps.pdf
    Enclosed are the few SAP notes related for improving performance.
    358921 - Oracle database parameterization for SEM
    459897 - SEM-CPM: Performance when reading transaction data
    566713 – Required information for the analysis of performance problems 
    560369 - Proposals BW aggregates for SEM-BPS
    180605 - Oracle database parameter settings for BW
    124361 - Oracle parameterization (R/3 >= 4.x, Oracle 8.x / 9.x)
    358529 - Overview of performance notes
    350011 - Technical performance: Using the business content
    340246 - Techn. performance: Overview of statistics   
    417091 - Optimize execution time of planning functions
    Some of them are Oracle specific, ignore them if you are not oracle database. Hope this helps.
    Thanks,
    Praveen
    PS.Dont forget to reward points

  • JSP causes serious performance problem in my EP

    I have a native JSP application and running it on the EP. This application accessing a Oracle db (using oracle.jdbc.driver.OracleDriver driver).
    When this db not running, my EP doesn't open any page. The EP try to connect with this db, but not get success.
    I modify this application with TRY and CATCH to treat the application problem, but the EP problem continues.
    In the EP Thread Overview (System Adm -> Monitoring -> Portal -> Thread Overview), I see threads (locked) about this application. To unlock this threads, I delete the par file from the Portal and re-deploy it.
    When this threads is deleted, the application treat the problem (display a error message in the iView container) and EP work normally.
    My questions:
    1) Exists some way that the problem with this application does not cause performance problems with the EP (via code or property)?
    2) Exists some property in the Config Tool where I configure the connection timeout for access the external DB?
    3) Exists some way to liberate these (locked) threads of the EP (I see the page Clearing the Portal Runtime Cache - http://help.sap.com/saphelp_nw04/helpdata/en/d2/a216e1bd7b431c82fa5ff105187112/frameset.htm - but I don't know if I can use it for this)
    I use EP 6.0 SP 15.
    Thanks,
    Yuri Fiori de Almeida

    Hi Umair,
    the code is:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" %>
    <%@ include file="isa_cad.jsp" %>
    <%
    Connection Connselect_localidade = null;
    try{
         Driver Driverselect_localidade = (Driver)Class.forName(MM_isa_cad_DRIVER).newInstance();
         Connselect_localidade = DriverManager.getConnection(MM_isa_cad_STRING,MM_isa_cad_USERNAME,MM_isa_cad_PASSWORD);
         PreparedStatement Statementselect_localidade = Connselect_localidade.prepareStatement("SELECT DISTINCT X AS Y FROM Z.K WHERE W = 1 ORDER BY X");
         ResultSet select_localidade = Statementselect_localidade.executeQuery();
         boolean select_localidade_isEmpty = !select_localidade.next();
         boolean select_localidade_hasData = !select_localidade_isEmpty;
         Object select_localidade_data;
         int select_localidade_numRows = 0;
    %>
    <!---- Page Layout --->
    <%
              select_localidade_hasData = select_localidade.next();
         select_localidade.close();
         Statementselect_localidade.close();
    //Connselect_localidade.close();
    %>
    <!---- Page Layout --->
    <%
    catch(Exception e){
    %>
    <!---- Page Layout ---><%
    finally{
         try{
              if(Connselect_localidade != null) Connselect_localidade.close();
         catch(Exception e){
    %>
    Thanks,
    Yuri.

  • Query Performance Problem!! Oracle 25 minutes || SQLServer 3 minutes

    Hi all,
    I'm having a performance problem with this query bellow. It runs in 3 minutes on SQLServer and 25 minutes in Oracle.
    SELECT
    CASE WHEN (GROUPING(a.estado) = 1) THEN 'TOTAL'
    ELSE ISNULL(a.estado, 'UNKNOWN')
    END AS estado,
    CASE WHEN (GROUPING(m.id_plano) = 1) THEN 'GERAL'
    ELSE ISNULL(m.id_plano, 'UNKNOWN')
    END AS id_plano,
    sum(m.valor_2s_parcelas) valor_2s_parcelas,
    convert(decimal(15,2),convert(int,sum(convert(int,(m.valor_2s_parcelas+.0000000001)*100)*
    isnull(e.percentual,0.0))/100.0+.0000000001))/100 BB_Educar
    FROM
    movimento_dco m ,
    evento_plano e,
    agencia_tb a
    WHERE
    m.id_plano = e.id_plano
    AND m.agencia *= a.prefixo
    --AND  m.id_plano LIKE     'pm60%'
    AND m.data_pagamento >= '20070501'
    AND m.data_pagamento <= '20070531'
    AND m.codigo_retorno = '00'
    AND m.id_parcela > 1
    AND m.valor_2s_parcelas > 0.
    AND e.id_evento = 'BB-Educar'
    AND a.banco_id = '001'
    AND a.ordem = '00'
    group by m.id_plano, a.estado WITH ROLLUP
    order by a.estado, m.id_plano DESC
    Can anyone help me with this query?

    What version of Oracle, what version of SQL? Are the tables the same exact size? are they both indexed the same? Are you running on the some or similar hardware? Are the Oracle parameters similar like SGA size and PGA_AGGREGATE Target? Did you run statistics in Oracle?
    Did you compare execution plans in SQL Server vs Oracle to see if SQl Servers execution plan is more superior than the one Oracle is trying to use? (most likely stale statistics).
    There are many variables and we need more information than just the Query : ).

  • Performance Problem, RPC Call auf SQLServer 2000

    Hi,
    we have a performance problem with SQLServer 2000. We use Bea WLS 6.1, SQLServer
    2000, and JDBC Driver mssqlserver4v65.jar from Bea.
    we use this for performance optimization as in Documetation at
    "http://www.datadirect-technologies.com/download/docs/jdbc/Jdbcref/jdbcdesign.html"
    case 2
    Stored Procedure can be optimized to use a server-side RPC. Because the application
    calls the procedure by name and the argument values are already encoded, the load
    on the database server is less
    CallableStatement cstmt = conn.prepareCall ("Call getCustName (?)");
    cstmt.setLong (1,12345);
    ResultSet rs = cstmt.executeQuery();
    But the checking in the SQlServer 2000 with SQL Profiler don't show the use of
    RPC Call.
    I can test the different from Query Analyser:
    exec IF_GetBueroStatistik 1 -> SQLProfiler: SQL:BatchCompleted
    {call IF_GetBueroStatistik(1)} -> SQlProfiler: RPC:Completed
    But the Call from Bea Aplication make in SQlProfiler alwasy SQl:BatchCompleted.
    The RPC ist faster from the Batch call.
    is that a bug in the driver implementation?
    can any help me with a solution or workaround?
    thanks Halim

    Hi,
    thank you very much Joe.
    Halim.
    Joseph Weinstein <[email protected]> wrote:
    >
    >
    Halim wrote:
    Hi,
    we have a performance problem with SQLServer 2000. We use Bea WLS 6.1,SQLServer
    2000, and JDBC Driver mssqlserver4v65.jar from Bea.You shouldn't be using the 6.5 version of the driver anyway. The 7.0
    version is better,
    but what you are seeing is that our driver does send fresh SQL for PreparedStatements,
    which is not as fast as using the RPC protocol. It's not a bug, but it
    is a feature we didn't
    implement.
    You should probably download and use the free driver from MS. It does
    implement
    the procedure protocol.
    Joe
    we use this for performance optimization as in Documetation at
    "http://www.datadirect-technologies.com/download/docs/jdbc/Jdbcref/jdbcdesign.html"
    case 2
    Stored Procedure can be optimized to use a server-side RPC. Becausethe application
    calls the procedure by name and the argument values are already encoded,the load
    on the database server is less
    CallableStatement cstmt = conn.prepareCall ("Call getCustName (?)");
    cstmt.setLong (1,12345);
    ResultSet rs = cstmt.executeQuery();
    But the checking in the SQlServer 2000 with SQL Profiler don't showthe use of
    RPC Call.
    I can test the different from Query Analyser:
    exec IF_GetBueroStatistik 1 -> SQLProfiler: SQL:BatchCompleted
    {call IF_GetBueroStatistik(1)} -> SQlProfiler: RPC:Completed
    But the Call from Bea Aplication make in SQlProfiler alwasy SQl:BatchCompleted.
    The RPC ist faster from the Batch call.
    is that a bug in the driver implementation?
    can any help me with a solution or workaround?
    thanks Halim

  • Performance problem with table COSS...

    Hi
    Anyone encountered performance problem with these table : COSS, COSB, COEP
    Best Regards

    >
    gsana sana wrote:
    > Hi Guru's
    >
    > this is the select Query which is taking much time in Production. so please help me to improve the preformance with BSEG.
    >
    > this is my select query:
    >
    > select  bukrs
    >               belnr
    >               gjahr
    >               bschl
    >               koart
    >               umskz
    >               shkzg
    >               dmbtr
    >               ktosl
    >               zuonr
    >               sgtxt
    >               kunnr
    >         from  bseg
    >         into  table gt_bseg1
    >          for  all entries in gt_bkpf
    >        where  bukrs eq p_bukrs
    >          and  belnr eq gt_bkpf-belnr
    >          and  gjahr eq p_gjahr
    >          and  buzei in gr_buzei
    >          and  bschl eq  '40'
    >          and  ktosl  ne  'BSP'.
    >
    > UR's
    > GSANA
    Hi,
    This is what I know and please if any expert think its incorrect, please do correct me.
    BSEG is a cluster table with BUKRS, BELNR, GJAHR and BUZEI as the key whereas other key will be stored in database as raw data thus SAP apps will need to convert that raw data first if we are using other keys in where condition. Hence, I suggest to use up to buzei in the where condition and filter other condition in internal table level like using Delete statement. Hope its help.
    Regards,
    Abraham

  • Performance problem using OBJECT tag

    I have a performance problem using the java plugin and was wondering if anyone else was has seen the same thing. I have a rather complex applet that interacts with java script in a web page using the LiveConnect API. The applet both calls javascript in the page and is called by java script.
    Im using IE6 with the java plugin that ships with the 1.4.2_06 JVM. I have noticed that if I deploy the applet using the OBJECT tags, the application seems the trash everytime I call a java method on the applet from javascript. When I deplot the same applet using the APPLET tag the perfomance is much better. I would like to use the OBJECT tag because it applet bahaves better and I have more control over the caching.
    This problem seems to be on the boundaries of IE6, JScript, the JVM and my Applet (and I suppose any could be the real culprit). My application is IE5+ specific so I can not test the applet in isolation from the surround HTML/JavaScript (for example in another browser).
    Does anyone have any idea?
    thanks in advance.
    dennis.

    I have a performance problem using the java plugin and was wondering if anyone else was has seen the same thing. I have a rather complex applet that interacts with java script in a web page using the LiveConnect API. The applet both calls javascript in the page and is called by java script.
    Im using IE6 with the java plugin that ships with the 1.4.2_06 JVM. I have noticed that if I deploy the applet using the OBJECT tags, the application seems the trash everytime I call a java method on the applet from javascript. When I deplot the same applet using the APPLET tag the perfomance is much better. I would like to use the OBJECT tag because it applet bahaves better and I have more control over the caching.
    This problem seems to be on the boundaries of IE6, JScript, the JVM and my Applet (and I suppose any could be the real culprit). My application is IE5+ specific so I can not test the applet in isolation from the surround HTML/JavaScript (for example in another browser).
    Does anyone have any idea?
    thanks in advance.
    dennis.

  • Performance problem when printing - table TSPEVJOB big size

    Hi,
    in a SAP ERP system there is performance problem when printing because table TSPEVJOB has many millions of entries.
    This table has reached a considerable size (about 90 Gb); db size is 200 Gb.
    Standard reports have been scheduled correctly and kernel of SAP ERP system is updated.
    I've tried to scheduled report RSPO1041 (instead of RSPO0041) to reduce entries but it is not possible run it during normal operations because it locks the printing system.
    Do you know why this table has increased ?
    Are there any reports to clean this table or other methods ?
    Thanks.
    Maurizio Manera

    Dear,
    Please see the Note 706478 - Preventing Basis tables from increasing considerably and
    Note 195157 - Application log: Deletion of logs.
    Note 1566659 - Table TSPEVJOB is filled excessively
    Note 1293472 - Spool work process hangs on semaphore 43
    Note 1362343 - Deadlocks in table TSP02 and TSPEVJOB
    Note 996455 - Deadlocks on TSP02 or TSPEVJOB when you delete
    For more information see the below link as,
    http://www.sqlservercurry.com/2008/04/how-to-delete-records-from-large-table.html
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=91179
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83525
    If any doubts Let me know.
    Thomas
    Edited by: thomas_raja on Aug 7, 2011 12:29 PM

  • OCCI VS 2008 & OCCI 11.1.0.6.0  Performance Problem

    I have been using VS C++ 2003 in combination with the oracle instant client 10.2.0.4 in our tool. We now moved to VS C++ 2008 (Express Edition) and oracle instant client 11.1.0.6.0 as listed at
    [http://www.oracle.com/technology/tech/oci/occi/occidownloads.html]
    I noticed a significant performance change for even simple queries on using the 11.1.0.6.0 client.
    Does anybody else noticed any performance problems with the 11.1.0.6.0 client libraries for VS C++9(VS 2008) 32 bit?
    I made a small test program which just connects to the db instance and makes a simple select and afterwards iterate through the result and calculate count by just incrementing. Following is the output of the same program, first with the 11.1.0.6.0 client and afterwards with the 10.2.0.4.0 client.
    Testing OCCI
    Using Oracle Client:Oracle 11.1.0.6.0
    Connected to Server lsy_ext.world
    Version :Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.5.0 - Production
    beginning select :select * from schedule
    Current time and date: Tue Mar 17 13:05:27 2009
    Select finished:select * from schedule
    Current time and date: Tue Mar 17 13:05:31 2009
    beginning iteration through result
    Current time and date: Tue Mar 17 13:05:31 2009
    iteration finished
    Current time and date: Tue Mar 17 13:05:31 2009
    Total Data for
    select * from schedule
    Count = 578
    beginning select :select * from leg
    Current time and date: Tue Mar 17 13:05:31 2009
    Select finished:select * from leg
    Current time and date: Tue Mar 17 13:05:36 2009
    beginning iteration through result
    Current time and date: Tue Mar 17 13:05:36 2009
    iteration finished
    Current time and date: Tue Mar 17 13:05:48 2009
    Total Data for
    select * from leg
    Count = 981011
    Testing OCCI
    Using Oracle Client:Oracle 10.2.0.4.0
    Connected to Server lsy_ext.world
    Version :Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.5.0 - Production
    beginning select :select * from schedule
    Current time and date: Tue Mar 17 13:04:03 2009
    Select finished:select * from schedule
    Current time and date: Tue Mar 17 13:04:03 2009
    beginning iteration through result
    Current time and date: Tue Mar 17 13:04:03 2009
    iteration finished
    Current time and date: Tue Mar 17 13:04:03 2009
    Total Data for
    select * from schedule
    Count = 578
    beginning select :select * from leg
    Current time and date: Tue Mar 17 13:04:03 2009
    Select finished:select * from leg
    Current time and date: Tue Mar 17 13:04:03 2009
    beginning iteration through result
    Current time and date: Tue Mar 17 13:04:03 2009
    iteration finished
    Current time and date: Tue Mar 17 13:04:15 2009
    Total Data for
    select * from leg
    Count = 981011
    Apparently, each select statement takes round about 5 seconds with the 11 client libraries. Does anybody has an explanation for this?
    beginning select :select * from schedule
    Current time and date: Tue Mar 17 13:05:*27* 2009
    Select finished:select * from schedule
    Current time and date: Tue Mar 17 13:05:*31* 2009
    Thank you
    Benny
    Edited by: bennyvar on Mar 18, 2009 12:25 PM

    I started visual studio with logging turned on. Here are the results from the log file:
    <entry>
    <record>60</record>
    <time>2008/01/18 19:14:09.974</time>
    <type>Information</type>
    <source>Microsoft Visual Studio</source>
    <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
    </entry>
    <entry>
    <record>61</record>
    <time>2008/01/18 19:14:11.026</time>
    <type>Warning</type>
    <source>Microsoft Visual Studio Appid Stub</source>
    <description>CheckPackageSignature failed; invalid Package Load Key</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
    </entry>
    <entry>
    <record>62</record>
    <time>2008/01/18 19:14:11.056</time>
    <type>Information</type>
    <source>Microsoft Visual Studio</source>
    <description>Begin package load [Oracle Developer Tools for Visual Studio .NET]</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
    </entry>
    <entry>
    <record>63</record>
    <time>2008/01/18 19:14:16.273</time>
    <type>Error</type>
    <source>Microsoft Visual Studio</source>
    <description>SetSite failed for package [Oracle Developer Tools for Visual Studio .NET]</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
    <hr>80004005 - E_FAIL</hr>
    </entry>
    <entry>
    <record>64</record>
    <time>2008/01/18 19:14:16.313</time>
    <type>Error</type>
    <source>Microsoft Visual Studio</source>
    <description>End package load [Oracle Developer Tools for Visual Studio .NET]</description>
    <guid>{D601BB95-E404-4A8E-9F24-5C1A462426CE}</guid>
    <hr>80004005 - E_FAIL</hr>
    </entry>

Maybe you are looking for