Performance issue using webelements and crystal

We have 2 reports named, u201CDAMAGE_REPORTSu201D AND u201CTDI_CHARTu201D
DAMAGE_REPORTS
There are 13 dynamic or static Prompts created using Webelements .After clicking on submit button(using
webelement)  by selecting the prompt values, TDI_CHART report will get opened below the u201CDAMAGE_REPORTSu201D report.
TDI_CHART
TDI_CHART created using free-hand SQL which contains 2 commands
        1. Command-SQL is created based on two categories.
              Trend -Trend By Month ,Trend By Quarter,Trend By Week
               Non-Trend- Current Month ,Current Year to Date,Last Year to Date,Current Quarter,Last
                             Quarter,Current Week,Last Week,Last Month,Last Year Total
             Charts,Cross-tabs and table information is coming from this Query
       2.Image count-contains number of images information based on the prompt selection and it acts as a 
              URL(opendocument) in the report to open TDI_THUMBNAIL report to display the thumbnail images.
Report information
TDI_CHART Report contains 8 charts,4 cross-tabs, summary information showing in table format(Detail
       section) and2 open document links(1.For image count 2.Export to excel(which shows the detail information
        of summary table)
Description
If the selection is Non-Trend Value from the Time period parameter , corresponding Chart will be shown along   with table information.(Table information is only required for Non-Trend Values).
If the Selection is Trend Value from the Time period parameter,the corresponding cross tab and chart will be shown and others will get suppressed.
Problem Area
After the prompt selection from u201CDamage_Reportsu201D, TDI_CHART report is taking around 1min 30 sec to show the chart and table or cross-tab.
In Database when we execute the above queries, it comes in 12 secs but whereas in reports it takes 1min 30 sec,can you guide us some steps to bring down this time?

hello Mufiza,
copy the url created at the step "After the prompt selection from u201CDamage_Reports".
paste this url into a new browser window and press enter.
what is the time to return this report?...this time should also be 1.5 minutes.
it sounds like you are using 2 commands in the same report. this will often cause performance issues, just like linking two stored procedures together or linking two disparate datasources together.
this would not be an issue related to webelements but related to the design of your target report.
jw

Similar Messages

  • Performance issue using WebView and OpenLayers

    Hi Team,
    i am running javafx 2.2 from jdk7u21.
    openlayers version used is 2.12
    when i am trying to add a huge number of vectors to a vector layer, the CPU usage goes high and nothing gets displayed.
    Most of the CPU usage is done by com.sun.javafx.sg.prism.NGWebView.update()
    it works well till around 4K vectors, but goes for a toss beyond that.
    OpenLayers Code is as follows.
    vector layer Definition
    ==============
    var vector1= new OpenLayers.Layer.Vector("Drivers",{
    styleMap: new OpenLayers.StyleMap({
    "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
    pointRadius: 3,
    fillColor : "blue",
    graphicName : "circle",
    fillOpacity : 1
    }, OpenLayers.Feature.Vector.style["default"])),
    "select": new OpenLayers.Style({
    externalGraphic: "${select_externalGraphic}"
    vector1.events.on({
    "featureselected": function(e) {
    //TODO: on Selection
    app.printOnConsole("From Vector Event>>"+e.feature.attributes.name);
    app.printOnConsole("From Vector Event"+Object.toJSON(e.feature.attributes));
    "featureunselected": function(e) {
    //TODO: on Deslect:
    Adding the vector code
    ===============
    var mymarker = new OpenLayers.Feature.Vector(
    new OpenLayers.Geometry.Point(LON,LAT),{
    default_externalGraphic: 'triangle_8.png',
    select_externalGraphic: 'triangle_8.png',
    rat : jsonObj.rat
    mylayer.addFeatures([mymarker]);
    Please suggest if there is a way i can fine tune my code to display the vectors.

    If running under a windows make sure you use a 32 bit java runtime (64 bit java runtimes on windows do not have a JavaScript jit compiler and are many times slower).
    Try java 8, it has many performance improvements.
    https://jdk8.java.net/download.html
    Use code tags
    https://forums.oracle.com/forums/ann.jspa?annID=1622

  • Performance Issue using min() and max() in one SQL statement

    I have a simple query that selects min() and max() from one column in a table in one sql statment.
    The table has about 9 Million rows and the selected column has a non unique index. The query takes 10 secs. When i select min() and max() in separate statements, each takes only 10 msecs:
    This statement takes 10 secs:
    select min(date_key) , max(date_key)
    from CAPS_KPIC_BG_Fact_0_A
    where date_key != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    This statement takes 10 msecs:
    select min(date_key)
    from MYTABLE
    where date_key != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    union all
    select max(date_key) from MYTABLE
    Because the first statement is part of an autmatic generated SQL of an application, i can't change it and i have to optimize the data model. How can i speed up the first statement?

    I've ran similar query on a table that has 10 milliion rows, with an index on the date column
    This is what I have found:
    SQL> set timing on
      1  SELECT MIN(ID_DATE) MIN_DATE, MAX(ID_DATE) MAX_DATE
      2      FROM MY_DATE
      3*     WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    SQL> /
    MIN_DATE  MAX_DATE
    03-APR-76 06-JAN-02
    real: 43383
    SQL> SELECT MIN(ID_DATE) MIN_DATE FROM MY_DATE
      2   WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
      3  UNION ALL
      4  SELECT MAX(ID_DATE) MAX_DATE FROM MY_DATE
      5   WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
      6  /
    MIN_DATE
    03-APR-76
    06-JAN-02
    real: 20
    SQL> SELECT MIN_DATE, MAX_DATE FROM
      2  (SELECT MAX(ID_DATE) MAX_DATE FROM MY_DATE
      3  WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD')) ) A,
      4  (SELECT MIN(ID_DATE) MIN_DATE FROM MY_DATE
      5  WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD')) ) B
      6  /
    MIN_DATE  MAX_DATE
    03-APR-76 06-JAN-02
    real: 10
    SQL> My conculsion, there is nothing you can do to the tables that will improve that particular statement.
    Why can't you modify the application?

  • Performance issue with calendar and applescript

    Hi Community,
    I have a performance issue using applescript and calendar with this script:
    tell application "Calendar"
              tell calendar "Cal"
                                            set theList to (get {summary, start date, end date, uid} of events)
    end tell
    end tell
    There are app. 700 events in the calendar "Cal". Therefore the get-command takes about 15 seconds. The problem is, that iCal is completely blocked for this time. This means it is even not possilbe to scroll through the calendar. This problem occurs only under OS X 10.9. With OS X 10.8.x it is still possible to use calendar even a time-consuming get-command is processed.
    Any ideas? Maybe there is a way to reduce the task-priority of an applescript?

    I have to step in here...
    1) Must I set "None" or "On Time"
    - In order for the Calendar to fire an Alarm, it must know what time to fire the alarm. In the event of an All Day Event, it will go off at 12am. The option for "Repeat", below the "Alarm", states the frequency of the event (Daily, Weekly, Monthly, Yearly, etc). So to set an alarm that fires once a month, set the TIME you want the alarm to go off (Make sure "All Day" is unchecked if you want a specific time), then choose "On Time" for the "Alarm", and one of the several "Monthly" options for "Repeat". If I missed something in what you were asking, please let me know and I will do my best to more directly answer your question.
    2) Calendar cannot sync with the Mac.
    - Not directly. However, your phone automatically syncs with your Google Calendar, set up if you create your account. If you so choose, you may export your iCal calendar, import it into your Google calendar, and then use your Google calendar (http://calendar.google.com) to manage your agenda. The changes sync automatically with your device.
    Once again, I hope this shed some light on things. To the Verizon rep who originally answered this question: I have no intention to bash you, however please bear in mind that your opinions and comments will always be held in higher regard than mine, so if you choose to answer a question, please try to solve the problem as opposed to just answer the question. I have experience with all manner of devices and operating systems, from WebOS to BB to iOS to Android, and I believe this phone has the best hardware coupled with a solid operating system in TouchWiz, and I don't want to see people frustrated with these devices by questions that get nothing more than, "You can't do that" answers from the people that are expected to support them.

  • Help with Video Performance Issues using Flash

    Asking on behalf of a customer who has been unable to get any answers so far - are you able to help?
    Background:
    We have a port of our Game Development Kit which allows us to recompile all our games using Crossbridge (http://adobe-flash.github.io/crossbridge/) into SWF without any code modifications.
    Overview:
    Our framework is using OpenGL for rendering and we have successfully ported it along with the audio and video to run in Flash.
    We are experiencing performance issues using Video. We cannot use image sequence as some of the video animations are too long and would increase the download to an unacceptable size.  Assets vary between 256x256 - 1024x1024 videos.

    Here's the rest of the story.  Let me know if you can see any resolution, and I will connect him to the forums.  Thank you.
    Current Video Solution:
    We create an instance of NetConnection, NetStream, and Video according to most samples out there, and invoke draw to rasterize the Video DisplayObject into a BitmapData instance.
    The BitmapData instance has a fixed color component layout which is not compatible with Stage3D texture and is therefore has to be reformatted before uploaded to Stage3D Texture (See Code Listing below).
    Our Problems:
    Performance issues with RGBA conversion (either using copyChannel or manually reformatting is not fast enough) natively in as3; this required for stage3d texture.Copying each channel individual using bitmapdata.Copychannel seems faster, but not significantly faster.
    Cannot detect when video frame has been updated, therefore we may copy pixels that are not needed in enterframe (processpixel).
    Looping video, our current solution uses the NET_STATUS event Buffer empty; Is there a better way to loop videos than checking buffer and seeking to 0.
    Stepping video, loading FLV or MP4 side by side assets from HTTP or embedded does not support stepping? Is there another way?
    ActionScript Code Listing:
    video_nc = new NetConnection();
    video_nc.addEventListener(NetStatusEvent.NET_STATUS , onConnect);
    video_nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR , trace);
    video_nc.connect(null);
    // OnConnect Event:
    this.ns = new NetStream(e.target as NetConnection);
    eventclient = new Object();
    eventclient.onMetaData = onMetaData;
    this.ns.client = eventclient;
    ns.play(flvfile);
    ns.pause();
    //onMetaData event:
    this.width = infoObject.width;
    this.height = infoObject.height;
    this.textureWidth = NextPowerOfTwo(this.width);
    this.textureHeight = NextPowerOfTwo(this.height);
    cliprect = new Rectangle(0, 0, this.width ,this.height);
    cliprect.x = 0;
    cliprect.y = 0;
    cliprect.width = this.textureWidth;
    cliprect.height = this.textureHeight;
    totalFrames = infoObject.duration * infoObject.fps;
    this.hasAlpha = true;
    if(infoObject.videocodecid == 5)
    this.hasAlpha = true;
    this.bitmapData = new BitmapData(this.textureWidth, this.textureHeight, hasAlpha, 0xff000000);
    this.video = new Video(this.width, this.height);
    this.video.attachNetStream(ns);
    this.video.addEventListener(Event.ENTER_FRAME, processPixels);
    // processPixel method:
    BitmapData.draw(video);
    GLAPI.instance.glBindTexture(GLAPI.GL_TEXTURE_2D,this.textureId);
    var fmt:uint = GLAPI.GL_ARGB;
    // converting pixels using copychannel or loop through pixels
    GLAPI.instance.glBindTexture(GLAPI.GL_TEXTURE_2D,this.textureId);
    GLAPI.instance.glTexImage2D(GLAPI.GL_TEXTURE_2D, 0, fmt, this.textureWidth, this.textureHeight, 0,fmt, GLAPI.GL_UNSIGNED_BYTE, 0, convBitmapData.getPixels(cliprect));

  • Performance Issue For Opening And Closing Balance In FBL1N/3N/5N

    Dear experts,
                        I Am Having Requirement to Bring Opening And Closing Balance In FBL1N, FBL3N, FBL5N.
    For This requirement I Used BADI : FI_ITEMS_CH_DATA~CHANGE_ITEMS, below is my Code For FBL1N, And I've Done the same For 3N/5N...With Related BAPI
    *   IF SY-TCODE = 'FBL1N'.
    *    LOOP AT ct_items INTO gs_items.
    *      CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    *        EXPORTING
    *          date      = gs_items-budat
    *          days      = '01'
    *          months    = '00'
    *          signum    = '-'
    *          years     = '00'
    *        IMPORTING
    *          calc_date = lv_date.
    *      CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
    *        EXPORTING
    *          companycode        = gs_items-bukrs
    *          vendor             = gs_items-konto
    *          keydate            = lv_date
    **   BALANCESPGLI       = ' '
    **   NOTEDITEMS         = ' '
    ** IMPORTING
    **   RETURN             =
    *        TABLES
    *          keybalance         =  lv_obal.
    *      CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
    *        EXPORTING
    *          companycode        = gs_items-bukrs
    *          vendor             = gs_items-konto
    *          keydate            = gs_items-budat
    **   BALANCESPGLI       = ' '
    **   NOTEDITEMS         = ' '
    ** IMPORTING
    **   RETURN             =
    *        TABLES
    *          keybalance         = lv_cbal
    *      READ TABLE lv_cbal INTO gs_cbal INDEX 1.
    *      gs_items-cbal = gs_cbal-lc_bal.
    *      READ TABLE lv_obal INTO gs_obal INDEX 1.
    *      gs_items-obal = gs_obal-lc_bal.
    *      MODIFY ct_items FROM gs_items TRANSPORTING obal cbal.
    *      CLEAR: gs_items,gs_obal,gs_cbal.
    *    ENDLOOP.
    *   ENDIF.
    So, Above Code Causing Me the Performance Issue, Kindly Suggest Me the Solution..
    Regards,
    uday.

    Hi Uday,
    I am sending you the code i used for the creation a Zreport based on FBL5N. Please check if it can of any help.
    *& Report  ZFBL5N                                                      *
    REPORT  zfbl5n_new  .
    TABLES : bsid,knc1,lfc1.
    TYPE-POOLS: slis.
    TYPES: BEGIN OF ty_bsid,
              bukrs TYPE bsid-bukrs,
              kunnr TYPE bsid-kunnr,
              belnr TYPE bsid-belnr,
              buzei TYPE bsid-buzei,
              bldat TYPE bsid-bldat,
              blart TYPE bsid-blart,
              bschl TYPE bsid-bschl,
              shkzg TYPE bsid-shkzg,
              dmbtr TYPE bsid-dmbtr,
              augdt TYPE bsid-augdt,
              augbl TYPE bsid-augbl,
              zuonr TYPE bsid-zuonr,
              sgtxt TYPE bsid-sgtxt,
              zfbdt TYPE bsid-zfbdt,
              zterm TYPE bsid-zterm,
              zbd1t TYPE bsid-zbd1t,
              zbd2t TYPE bsid-zbd2t,
              zbd3t TYPE bsid-zbd3t,
              kkber TYPE bsid-kkber,
              bstat TYPE bsid-bstat,
              umskz TYPE bsid-umskz,
            END OF ty_bsid.
    TYPES: BEGIN OF ty_bsik,
             bukrs TYPE bsik-bukrs,
              lifnr TYPE bsik-lifnr,
              belnr TYPE bsik-belnr,
              buzei TYPE bsik-buzei,
              bldat TYPE bsik-bldat,
              blart TYPE bsik-blart,
              bschl TYPE bsik-bschl,
              shkzg TYPE bsik-shkzg,
              dmbtr TYPE bsik-dmbtr,
              augdt TYPE bsik-augdt,
              augbl TYPE bsik-augbl,
              zuonr TYPE bsik-zuonr,
              sgtxt TYPE bsik-sgtxt,
               zfbdt TYPE bsik-zfbdt,
    *         KKBER TYPE bsik-kkber,
              zterm TYPE bsik-zterm,
               zbd1t TYPE bsik-zbd1t,
              zbd2t TYPE bsik-zbd2t,
              zbd3t TYPE bsik-zbd3t,
              bstat TYPE bsid-bstat,
              umskz TYPE bsid-umskz,
            END OF ty_bsik.
    TYPES: BEGIN OF ty_final,
              belnr TYPE bsid-belnr,
    *         buzei TYPE bsak-buzei,
              bldat TYPE bsid-bldat,
              blart TYPE bsid-blart,
              chq TYPE bsid-zuonr,
              debit TYPE bsid-dmbtr,
              credit TYPE bsid-dmbtr,
              txt TYPE bsid-sgtxt,
              date TYPE bsid-zfbdt,
              kkber TYPE bsid-kkber,
              zterm TYPE bsid-zterm,
              augbl TYPE bsid-augbl,
              augdt TYPE bsid-augdt,
              flag TYPE c,
            END OF ty_final.
    TYPES : BEGIN OF gs_openbal,
              bukrs TYPE bapi3007_2-comp_code,
              kunnr TYPE bapi3007_2-customer,
              dmbtr TYPE bapi3007_2-lc_amount,
             END OF gs_openbal.
    DATA: it_bsid TYPE STANDARD TABLE OF ty_bsid,
           it_bsik TYPE STANDARD TABLE OF ty_bsik,
           it_final TYPE STANDARD TABLE OF ty_final.
    DATA: wa_bsid TYPE ty_bsid,
           wa_bsik TYPE ty_bsik,
           wa_final TYPE ty_final.
    DATA: w_days TYPE t5a4a-dlydy,
           w_month TYPE t5a4a-dlymo,
           w_year TYPE t5a4a-dlyyr,
           w_date TYPE p0001-begda,
           w_name1 TYPE kna1-name1,
           w_ort01 TYPE kna1-ort01,
           w_lifnr TYPE kna1-lifnr,
           w_dmbtr1 TYPE bsid-dmbtr,
           w_dmbtr2 TYPE bsid-dmbtr,
           w_dmbtr3 TYPE bsad-dmbtr,
           w_dmbtr4 TYPE bsad-dmbtr,
           w_opbal TYPE bsid-dmbtr,
           w_credit TYPE bsik-dmbtr,
           w_debit TYPE bsik-dmbtr,
           w_clobal TYPE bsik-dmbtr,
           w_credit1 TYPE bsik-dmbtr,
           w_debit1 TYPE bsik-dmbtr,
           w_clobal1 TYPE bsik-dmbtr.
    DATA: ld_yrper LIKE rwcoom-fiscper,
           kunnr LIKE kna1-kunnr,
           x_norm TYPE c,
           x_park,
           x_apar,
           x_merk,
           ok_code(4),
           wa_x001 LIKE x001,
           return LIKE bapireturn,
           line_count LIKE sy-loopc,
           number_of_records TYPE i,
           xindex LIKE sy-tabix,
           open LIKE knc1-um01s,
           temp(20),
           close LIKE knc1-um01s,
           gjahr LIKE bsid-gjahr,
           period LIKE bkpf-monat,
           f(1),
           v_char(2),
           closec(20),
           openc(20),
           debit LIKE bapi3007_2-lc_amount,
           credit LIKE debit.
    DATA : v_dmbtr LIKE bsid-dmbtr.
    *DATA : tot_debit LIKE t_ar-debit,
    *       tot_credit LIKE t_ar-credit.
    DATA : t_kna1 LIKE kna1 OCCURS 1  WITH HEADER LINE,
            t_knb1 LIKE knb1 OCCURS 10 WITH HEADER LINE.
    DATA ibsid LIKE bsid OCCURS 0 WITH HEADER LINE.
    DATA ibsad LIKE bsad OCCURS 0 WITH HEADER LINE.
    DATA ibsik LIKE bsik OCCURS 0 WITH HEADER LINE.
    DATA ibsak LIKE bsak OCCURS 0 WITH HEADER LINE.
    DATA : it_fieldcat_alv   TYPE slis_t_fieldcat_alv,
            wa_fieldcat_alv     TYPE slis_fieldcat_alv,
            is_layout_alv  TYPE slis_layout_alv,
            wa_layout_alv  TYPE slis_layout_alv,
            it_list_top_of_page TYPE slis_t_listheader,
            it_events TYPE slis_t_event,
            wa_events TYPE LINE OF slis_t_event.
    DATA : BEGIN OF ibukrs OCCURS 0,
               bukrs LIKE t001-bukrs,
              END OF ibukrs.
    DATA : BEGIN OF ikunnr1 OCCURS 0,
              kunnr LIKE knc1-kunnr,
             END OF ikunnr1.
    DATA : BEGIN OF ikunnr OCCURS 0,
               kunnr LIKE knc1-kunnr,
               bukrs LIKE t001-bukrs,
               lifnr LIKE lfc1-lifnr,
              END OF ikunnr.
    DATA: it_sort TYPE slis_t_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    DATA:    r_bschl TYPE RANGE OF bschl,
              wa_bschl LIKE LINE OF r_bschl.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_kunnr TYPE bsid-kunnr OBLIGATORY,
                  p_bukrs TYPE bsid-bukrs OBLIGATORY.
    SELECT-OPTIONS: so_budat FOR bsid-budat .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS : p_normal AS CHECKBOX,
                  p_spl    AS CHECKBOX,
                  p_vendor AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b2.
    PERFORM get_data.
    PERFORM process_data.
    *PERFORM calculate_openbal. " Commented by anish
    PERFORM calculate_open_bal.
    PERFORM calculate_closing_bal.
    PERFORM build_catalog_sort USING it_sort.
    PERFORM reuse_alv_events_get .
    PERFORM display_data.
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_data .
       SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
         bstat umskz FROM bsid
         INTO TABLE it_bsid
         WHERE bukrs = p_bukrs
          AND kunnr = p_kunnr
          AND budat IN so_budat.
       SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
        bstat umskz FROM bsad
        APPENDING TABLE it_bsid
        WHERE bukrs = p_bukrs
         AND kunnr = p_kunnr
         AND budat IN so_budat.
       SELECT SINGLE name1 ort01 lifnr FROM kna1
         INTO (w_name1 , w_ort01 , w_lifnr)
         WHERE kunnr = p_kunnr.
       IF p_vendor IS NOT INITIAL.
         SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
         bstat umskz   FROM bsik
         APPENDING TABLE it_bsik
         WHERE bukrs = p_bukrs
           AND lifnr = w_lifnr
           AND budat IN so_budat.
         SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
         bstat umskz  FROM bsak
        APPENDING TABLE it_bsik
        WHERE bukrs = p_bukrs
          AND lifnr = w_lifnr
          AND budat IN so_budat.
       ENDIF.
       SORT it_bsid BY bschl.
       DELETE  it_bsid WHERE bschl = '04'.
       DELETE  it_bsid WHERE bschl = '07'.
       DELETE  it_bsid WHERE bschl = '17'.
       DELETE  it_bsid WHERE bschl = '34'.
       DELETE  it_bsid WHERE bschl = '27'.
       DELETE  it_bsid WHERE bschl = '37'.
       SORT it_bsik BY bschl.
       DELETE  it_bsik WHERE bschl = '04'.
       DELETE  it_bsik WHERE bschl = '07'.
       DELETE  it_bsik WHERE bschl = '17'.
       DELETE  it_bsik WHERE bschl = '34'.
       DELETE  it_bsik WHERE bschl = '27'.
       DELETE  it_bsik WHERE bschl = '37'.
    ENDFORM.                    " GET_DATA
    *&      Form  PROCESS_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM process_data .
       DATA:okay       TYPE c VALUE space.
       w_month = '00'.
       w_year = '00'.
       SORT it_bsid BY bldat .
       LOOP AT it_bsid INTO wa_bsid.
         PERFORM check_item_ok  USING p_normal
                                      p_spl
                                      p_vendor
    *                               x_park
                                      wa_bsid
                                CHANGING okay.
         CHECK okay = 'X'.
         wa_final-belnr = wa_bsid-belnr.
         wa_final-bldat = wa_bsid-bldat.
         wa_final-blart = wa_bsid-blart.
         wa_final-txt = wa_bsid-sgtxt.
         wa_final-kkber = wa_bsid-kkber.
         wa_final-zterm = wa_bsid-zterm.
         wa_final-augbl = wa_bsid-augbl.
         wa_final-augdt = wa_bsid-augdt.
         wa_final-flag = 'C'.
         IF wa_bsid-blart = 'DZ'.
           wa_final-chq = wa_bsid-zuonr.
         ENDIF.
         IF wa_bsid-shkzg = 'S'.
           wa_final-debit = wa_bsid-dmbtr.
         ELSEIF wa_bsid-shkzg = 'H'.
           wa_final-credit = wa_bsid-dmbtr.
         ENDIF.
         w_credit = w_credit + wa_final-credit.
         w_debit = w_debit + wa_final-debit.
    ****** Net due  date
         IF wa_bsid-zbd1t IS NOT INITIAL.
           w_days = wa_bsid-zbd1t.
         ELSEIF wa_bsid-zbd2t IS NOT INITIAL.
           w_days = wa_bsid-zbd2t.
         ELSEIF wa_bsid-zbd3t IS NOT INITIAL.
           w_days = wa_bsid-zbd3t.
         ENDIF.
         IF w_days IS INITIAL.
           wa_final-date = wa_bsid-zfbdt.
         ELSE.
           CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
             EXPORTING
               date      = wa_bsid-zfbdt
               days      = w_days
               months    = w_month
               signum    = '+'
               years     = w_year
             IMPORTING
               calc_date = w_date.
           wa_final-date = w_date.
         ENDIF.
         APPEND wa_final TO it_final.
         CLEAR: w_days , w_date , wa_final .
       ENDLOOP.
       IF it_bsik IS NOT INITIAL.
         CLEAR: w_days , w_date.
         SORT it_bsik BY bldat.
         LOOP AT it_bsik INTO wa_bsik.
           wa_final-belnr = wa_bsik-belnr.
           wa_final-bldat = wa_bsik-bldat.
           wa_final-blart = wa_bsik-blart.
           wa_final-txt = wa_bsik-sgtxt.
    *    wa_final-kkber = wa_bsik-kkber.
           wa_final-zterm = wa_bsik-zterm.
           wa_final-augbl = wa_bsik-augbl.
           wa_final-augdt = wa_bsik-augdt.
           wa_final-flag = 'V'.
           IF wa_bsik-blart = 'DZ'.
             wa_final-chq = wa_bsik-zuonr.
           ENDIF.
           IF wa_bsik-shkzg = 'S'.
             wa_final-debit = wa_bsik-dmbtr.
           ELSEIF wa_bsik-shkzg = 'H'.
             wa_final-credit = wa_bsik-dmbtr.
           ENDIF.
           w_credit1 = w_credit1 + wa_final-credit.
           w_debit1 = w_debit1 + wa_final-debit.
    *******  Net Due date
           IF wa_bsik-zbd1t IS NOT INITIAL.
             w_days = wa_bsik-zbd1t.
           ELSEIF wa_bsik-zbd2t IS NOT INITIAL.
             w_days = wa_bsik-zbd2t.
           ELSEIF wa_bsik-zbd3t IS NOT INITIAL.
             w_days = wa_bsik-zbd3t.
           ENDIF.
           IF w_days IS INITIAL.
             wa_final-date = wa_bsik-zfbdt.
           ELSE.
             CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
               EXPORTING
                 date      = wa_bsik-zfbdt
                 days      = w_days
                 months    = w_month
                 signum    = '+'
                 years     = w_year
               IMPORTING
                 calc_date = w_date.
           ENDIF.
           wa_final-date = w_date.
           APPEND wa_final TO it_final.
           CLEAR: wa_final.
         ENDLOOP.
       ENDIF.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  DISPLAY_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_data .
       wa_fieldcat_alv-fieldname = 'BELNR'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-003.
       wa_fieldcat_alv-outputlen = '11'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'BLDAT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-004.
       wa_fieldcat_alv-outputlen = '13'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'BLART'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-005.
       wa_fieldcat_alv-outputlen = '02'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'CHQ'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-006.
       wa_fieldcat_alv-outputlen = '09'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'DEBIT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-007.
       wa_fieldcat_alv-outputlen = '15'.
       wa_fieldcat_alv-do_sum = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'CREDIT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-008.
       wa_fieldcat_alv-outputlen = '15'.
       wa_fieldcat_alv-do_sum = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'TXT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-009.
       wa_fieldcat_alv-outputlen = '50'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'DATE'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-010.
       wa_fieldcat_alv-outputlen = '12'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'KKBER'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-011.
       wa_fieldcat_alv-outputlen = '04'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'ZTERM'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-012.
       wa_fieldcat_alv-outputlen = '13'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'AUGBL'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-013.
       wa_fieldcat_alv-outputlen = '15'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'AUGDT'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-seltext_l = text-014.
       wa_fieldcat_alv-outputlen = '17'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       wa_fieldcat_alv-fieldname = 'FLAG'.
       wa_fieldcat_alv-tabname = 'IT_FINAL'.
       wa_fieldcat_alv-tech = 'X'.
       APPEND wa_fieldcat_alv TO it_fieldcat_alv.
       CLEAR wa_fieldcat_alv.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program             = sy-repid
          is_layout                      = wa_layout_alv
          it_fieldcat                    = it_fieldcat_alv
    *   IT_EXCLUDING                   =
    *   IT_SPECIAL_GROUPS              =
          it_sort                        = it_sort
          it_events                      = it_events
          i_save                            = 'A'
         TABLES
           t_outtab                       = it_final
        EXCEPTIONS
          program_error                  = 1
          OTHERS                         = 2
       IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    *  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    *    EXPORTING
    *      i_callback_program                = sy-repid
    *     i_callback_top_of_page            = 'TOP_OF_PAGE'
    *      is_layout                         = wa_layout_alv
    *      it_fieldcat                       = it_fieldcat_alv
    *      it_sort                           = it_sort
    ***   I_DEFAULT                         = 'X'
    **      i_save                            = 'A'
    ***   IT_EVENTS                         =
    *     TABLES
    *       t_outtab                          = it_final
    *    EXCEPTIONS
    *      program_error                     = 1
    *      OTHERS                            = 2
    *  IF sy-subrc <> 0.
    *** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    ***         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  TOP_OF_PAGE
    *       Header at top of page.
    FORM top_of_page.
       SKIP 1.
       WRITE: AT 35 'Account Statement from' , so_budat-low , 'to' , so_budat-high.
       SKIP 2.
       WRITE: AT /5 'CUSTOMER:' , p_kunnr.
       WRITE: AT 35 'Name:' , w_name1.
       WRITE: AT /5 'Company:' , p_bukrs.
       WRITE: AT 35 'City:' , w_ort01.
       SKIP 1.
       WRITE: AT /5 'Opening Balance as on' , so_budat-low , '   ' ,  w_opbal LEFT-JUSTIFIED.
       SKIP 2.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  END_OF_PAGE
    *       Footer at End of page.
    FORM end_of_page.
       SKIP 2.
       IF so_budat-high IS NOT INITIAL.
         WRITE: AT 5 'Closing Balance as on' , so_budat-high , '   ' ,  w_clobal LEFT-JUSTIFIED.
       ELSE.
         WRITE: AT 5 'Closing Balance  ' , w_clobal LEFT-JUSTIFIED.
       ENDIF.
    ENDFORM.                    "end_of_page
    *&      Form  CALCULATE_OPENBAL
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM calculate_openbal .
       DATA:v_gjahr       TYPE bsid-gjahr.
       DATA: v_period LIKE  t009b-poper,v_monat LIKE t001-periv.
       CALL FUNCTION 'FI_PERIOD_DETERMINE'
              EXPORTING
                   i_budat        = so_budat-low
                   i_bukrs        = p_bukrs
    *           I_PERIV        = ' '
    *           I_GJAHR        = 0000
    *           I_MONAT        = 00
    *           X_XMO16        = ' '
              IMPORTING
                   e_gjahr        = v_gjahr
    *            e_monat        = v_monat
                   e_poper        = v_period.
       IF sy-subrc NE 0.
       ENDIF.
       DATA: f_date LIKE sy-datum.
       CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
         EXPORTING
           i_gjahr  = v_gjahr
           i_monmit = 00
           i_periv  = 'V3'
           i_poper  = v_period
         IMPORTING
           e_date   = f_date.
       period = v_period - 1.
       gjahr = v_gjahr.
       DATA wa_kna1 LIKE kna1.
       CALL FUNCTION 'READ_KNA1'
         EXPORTING
           xkunnr         = p_kunnr
         IMPORTING
           xkna1          = wa_kna1
         EXCEPTIONS
           key_incomplete = 1
           not_authorized = 2
           not_found      = 3
           OTHERS         = 4.
       IF sy-subrc <> 0.
         MESSAGE w023(zwww).
         CALL SCREEN 0010.
       ENDIF.
       MOVE-CORRESPONDING wa_kna1 TO t_kna1.
       APPEND t_kna1.
       SELECT kunnr FROM kna1 INTO TABLE ikunnr1
         WHERE kunnr = p_kunnr.
       SELECT bukrs FROM t001 INTO TABLE ibukrs
        FOR ALL ENTRIES IN t_knb1
        WHERE bukrs = t_knb1-bukrs.
       LOOP AT ikunnr1.
         LOOP AT ibukrs.
           ikunnr-kunnr = ikunnr1-kunnr.
           ikunnr-bukrs = ibukrs-bukrs.
           READ TABLE t_kna1 WITH  KEY kunnr = ikunnr1-kunnr.
           ikunnr-lifnr = t_kna1-lifnr.
           APPEND ikunnr.
         ENDLOOP.
       ENDLOOP.
       DELETE ikunnr WHERE bukrs NE p_bukrs.
       LOOP AT ikunnr.
         CLEAR: knc1,lfc1,f.
         IF NOT ( ikunnr-kunnr IS INITIAL ) AND NOT ( p_vendor IS INITIAL ).
           SELECT SINGLE * FROM lfc1
                  WHERE gjahr = gjahr AND bukrs = ikunnr-bukrs
                                      AND lifnr = ikunnr-lifnr.
         ENDIF.
         SELECT SINGLE * FROM knc1
           WHERE gjahr = gjahr AND bukrs = p_bukrs
                 AND kunnr = p_kunnr.
         IF sy-subrc = 0.
           CASE period .
             WHEN 12.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
               knc1-um11s - knc1-um11h + knc1-um12s - knc1-um12h.
               IF NOT ( lfc1 IS INITIAL ).
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
                 lfc1-um11s - lfc1-um11h + lfc1-um12s - lfc1-um12h.
               ENDIF.
             WHEN 11.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
               knc1-um11s - knc1-um11h.
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
                 lfc1-um11s - lfc1-um11h.
               ENDIF.
             WHEN 10.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h.
               ENDIF.
             WHEN 9.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
               knc1-um09s - knc1-um09h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
                 lfc1-um09s - lfc1-um09h.
               ENDIF.
             WHEN 8.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h.
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
                 lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h .
               ENDIF.
             WHEN 7.
               open = knc1-umsav +
               knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
               knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
               knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
               knc1-um07s - knc1-um07h .
               IF NOT ( lfc1 IS INITIAL ) .
                 open = open + lfc1-umsav +
                 lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
                 lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
                 lfc1-um05s - lfc1-um

  • SQL Performance issue: Using user defined function with group by

    Hi Everyone,
    im new here and I really could need some help on a weird performance issue. I hope this is the right topic for SQL performance issues.
    Well ok, i create a function for converting a date from timezone GMT to a specified timzeone.
    CREATE OR REPLACE FUNCTION I3S_REP_1.fnc_user_rep_date_to_local (date_in IN date, tz_name_in IN VARCHAR2) RETURN date
    IS
    tz_name VARCHAR2(100);
    date_out date;
    BEGIN
    SELECT
    to_date(to_char(cast(from_tz(cast( date_in AS TIMESTAMP),'GMT')AT
    TIME ZONE (tz_name_in) AS DATE),'dd-mm-yyyy hh24:mi:ss'),'dd-mm-yyyy hh24:mi:ss')
    INTO date_out
    FROM dual;
    RETURN date_out;
    END fnc_user_rep_date_to_local;The following statement is just an example, the real statement is much more complex. So I select some date values from a table and aggregate a little.
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stampThis statement selects ~70000 rows and needs ~ 70ms
    If i use the function it selects the same number of rows ;-) and takes ~ 4 sec ...
    select
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin'),
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin')I understand that the DB has to execute the function for each row.
    But if I execute the following statement, it takes only ~90ms ...
    select
    fnc_user_rep_date_to_gmt(stp_end_stamp,'Europe/Berlin','ny21654'),
    noi
    from
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stamp
    )The execution plan for all three statements is EXACTLY the same!!!
    Usually i would say, that I use the third statement and the world is in order. BUT I'm working on a BI project with a tool called Business Objects and it generates SQL, so my hands are bound and I can't make this tool to generate the SQL as a subselect.
    My questions are:
    Why is the second statement sooo much slower than the third?
    and
    Howcan I force the optimizer to do whatever he is doing to make the third statement so fast?
    I would really appreciate some help on this really weird issue.
    Thanks in advance,
    Andi

    Hi,
    The execution plan for all three statements is EXACTLY the same!!!Not exactly. Plans are the same - true. They uses slightly different approach to call function. See:
    drop table t cascade constraints purge;
    create table t as select mod(rownum,10) id, cast('x' as char(500)) pad from dual connect by level <= 10000;
    exec dbms_stats.gather_table_stats(user, 't');
    create or replace function test_fnc(p_int number) return number is
    begin
        return trunc(p_int);
    end;
    explain plan for select id from t group by id;
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from t group by test_fnc(id);
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from (select id from t group by id);
    select * from table(dbms_xplan.display(null,null,'advanced'));Output:
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL>
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "TEST_FNC"("ID")[22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL> select * from table(dbms_xplan.display(null,null,'advanced'));
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$F5BB74E1
       2 - SEL$F5BB74E1 / T@SEL$2
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$F5BB74E1" "T"@"SEL$2")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$1")
          MERGE(@"SEL$2")
          OUTLINE_LEAF(@"SEL$F5BB74E1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    37 rows selected.

  • Performance issues using JavaFX on different notebooks

    Hello,
    unfortunately i feel forced to ask a question about performance issues. As far as i understood, most of the problems with JavaFX 2.0 that are discussed here or somewhere else seem to have there roots in a huge count of nodes and/or some kind of animations. In opposition to this I'm writing a business application for the desktop with JavaFX as a Swing-replacement. There are no permanent animations at all and the scene has all in all 200 nodes(measured it with ScenicView) yet. I use no WebView-Nodes.
    The application runs very well on my development computer with 16 GB of RAM, a Intel Corei7 2600K processor and a mid-class AMD grafics device. Also, there are no performance issues on a Core i3 Notebook. As soon as i start the application on my Thinkpad X220 with Core i7-2620M CPU, 8 GB RAM and Intel HD graphics it get's almost unusable. For example, there is a diagramm(see attached screenshot), which is situated in a scrollpane. As soon as i try to pan it, the panning extremely slow(i'd say 2-4 fps). Another example is that hovering buttons is not very responsive. Moving the mouse over a button causes the hover effect 0.3-0.5 seconds after it entered the button. Fading transitions that i use at some places are not smooth as well.
    I made sure that the app is running using a hardware renderer on each computer. Also, i tried to force a fallback to the software renderer using the "-Dprism.order=j2d" switch but it only performed worse.
    So my first question is: Are there known issues with mobile processors/graphic devices of the mentioned type?

    I just tested it with Java 8 ea build 61 and beside the fact that a small amount of css didn't work anymore, it runs very well with this version of Java(/FX). Damn...i hope that some of this performance fixes will be backported to some Java 7 update.

  • Performance issues using multiple CC design programs?

    Hey! I'm Gwidz, and I'm having some performance issues with my adobe programs. I primarily use Photoshop, InDesign and Illustrator for design work. I find that when I have any two of them open, I experience delays in clicking and dragging using my pen tablet, and laggy zooming in/scrolling. This issue disappears when I only have one program open.
    I just bought this laptop to use these programs. Here's the specs:
    Operating system: Windows 8 64 bit
    Processor: 4th gen intel i7 4700HQ
    Ram: 16gb DDR3
    Graphics: NVIDIA GeForce GTX 770M 3GB GDDR5
    Cost me 2000 bucks on amazon, and I'm pretty disappointed in how things are going right now. I definitely don't think it could be a hardware issue, could it?
    I'm using an SSD as my scratch disc, and using the 64 bit versions of all programs that have it. Nothing else running in the background except these programs, and yet still I experience poor performance.
    Admitedly, I'm new to windows 8, and I'm learning everything that I can about it in hopes of resolving this issue.
    If anyone has any advice, any and all is greatly aprpeciated!

    I'm seeing this exact same choppiness and VERY slow response times with the same low use of CPU and memory... WITH JUST ONE APP OPEN!  Illustrator.
    Macbook Retina Pro, 15 inch.
    I've tried with the GPU forced off, and forced on, and on autoswitching.
    I've tried clean reinstalls.  And reboots. Etc.
    This is not hardware related.  It's something utterly flawed with the way Illustrator (and InDesign) draw do things.  They are just grotesquely inefficient.
    The fact that the program/app makes no effort to use more CPU/GPU to speed up responsiveness to the user input is the real indicator of how poorly optimised this code is. 
    After Effects is better.  But it's adaptive degradation STUTTERS grotesquely, and it's actually better to try to turn that off.  Although I'm having a hard time trying to figure out how to turn that off at the moment.. forgotten where I previously found that switch.
    Photoshop is also better. 
    I'm also talking about small files. Nothing in them.  Just start drawing... Stutters... atrocious frame rates for the update of the screen and very poor response rates to input.
    This is 64 bit optimised?  I don't think so.

  • Performance issue:Show id and Description for same dimension member

    Hi,
    I am connecting a cube to another reporting system and i need to show the id of member resulting of a query.My first thought was to use this kind of code (bellow) however when i do the same thing with many dimension (many cross join ),it slow down a lot
    my query.So how can i have in the same DImension member showing a description and id ? I also have a lot of statement,so i can't have just two columns in the dimension or i will need to duplication the mdx and i could drop down the performance.
    So i am trying to get as a result
    Dim1 | Dim2| Dim3| Measure
    1 50
    32 25.2
    and also be able to get
    Dim1                            |   Dim2                                  |  Dim3  
                                |                Measure
    NameElement1Dim1 NameElement50Dim2
    NameElement32Dim3 25.2
    Thanks in advance
    with MEMBER [Measures].[IdElement] as 
    <element>.currentmember.properties("KEY")
    select
    CROSSJOIN({[Measures].[IdElement]},{[METRIC].[Description].[All]}),
    CROSSJOIN({[Measures].[value]},{<listmetricmdx>})
    } on columns,
    <pointofview>
    <element_and_function>
    <TimeBreakdown>
    } on rows
    <list_filter_clause>
    ) as list
    where ((ElementName is null AND IdElement=0) OR (ElementName is not null))
    <list_condition_metric>
    but i have multiple 

    Hi Vincent,
    In your query, you use CrossJoin in it. Crossjoin function will cause the performance issue if there are a lot of properties that need to be displayed. If you cross-join medium-sized or large-sized sets (e.g., sets that contain more than 100 items each),
    you can end up with a result set that contains many thousands of items—enough to seriously impair performance. For the detail information, please see:
    http://sqlmag.com/data-access/cross-join-performance
    In your MDX query, ensure only retrieval the required data. Here are some useful links for your reference.
    Configure memory setting:
    http://social.msdn.microsoft.com/Forums/en/sqlanalysisservices/thread/bf70ca19-5845-403f-a85f-eac77c4495e6
    Performance Tuning:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=3be0488d-e7aa-4078-a050-ae39912d2e43&displaylang=en
    http://www.packtpub.com/article/query-performance-tuning-microsoft-analysis-services-part2
    Regards,
    Charlie Liao
    TechNet Community Support

  • Heavy performance issues using Adobe Interactive Form PDFs generated by SAP BPM

    Dear experts,
    we use Adobe Interactive Form PDFs (generated with LiveCycle Designer) as Human Tasks within SAP BPM processes. The PDFs are generated and transmitted correctly, but when they are opened at the receivers PC, Windows freezes for 2-3 minutes, then the PDF opens and can be filled out and sent back. The next PDFs can be opened much faster, but when the PC is restarted, we get the same problem again. We use Adobe Reader XI (11.0.2) on our clients; is their any know performance issue?
    Please note, that we have this problem with EVERY Adobe Interactive Form PDF... I created a simple PDF containing just a field and the client PC still freezes. So it can't be in the form or the scripting. Normal static PDFs can be opend without any problems.
    Best regards,
    David

    They haven't really announced it, because there is no product to announce. Rather the opposite.
    There are no conversion tools, so far as I know.
    XFA forms are a non-starter if you want portability.
    AcroForms are a nightmare in themselves, because the functionality is limited in Adobe Reader and varies between absent and weird in other products. No idea about Blackberry support.
    You will not find a simple recommendation. Rather, you need to use Acroforms and carefully test everything (EVERYTHING: no assumptions) on every platform you intend to support.
    Yes, rather unsatisfactory, but until Adobe realise that the future is platform equivalence or irrelevance, this is where we are.

  • Federated Portal - Issue running WebI and Crystal in Enterprise portal.

    Hi All,
    We have connected our BI portal to Enterprise Portal . The federation works fine for Bex 7.0 queries. But when we run WebI and Crystal Reports ...We get the following error
    Portal Runtime Error
    An exception occurred while processing your request
    Exception id: 05:20_30/03/10_0027_1281950
    See the details for the exception ID in the log file.
    We looked in the log file and this is what we see.
    "PortalRuntimeException: Exception in SAP Application Integrator occured: Missing Property &#39;ClassName&#39; in property file for layer&#39;BusinessObjects/SSOLayer&#39;."
    Others have posted the same question in forum but there is no answer. Could any of you resolve this issue??
    Thank you in advance,
    Aparna

    Hi Hanif,
    I'm working on federation between EP 7.4 and EP 7.0.
    Do you have any links on FPN in EP7.4.
    Thanks and Regards,
    Pradeep

  • Performance issue using WDPortalUtils.getService

    Hi,
    I have an application with multiple componnets inside a main component.
    If i perform ADD using ADD component it is not getting refreshing in the front end but it is getting refreshing in the back end.
    But if i refresh the application data is getting refreshed in the front end too
    I am refreshing my application for every  operation with the given code
    Willl it give any performance issue
    if(WDPortalUtils.isRunningInPortal()){
                      IWDPageService iWDPortalService=(IWDPageService)WDPortalUtils.getService(WDPortalServiceType.PAGE_SERVICE);
                      iWDPortalService.restartApplication();
    Regards
    Padma

    Anup,
    What will happen behind the screens when application restarts.
    what are the otherways of achieving the same Behavior,like getting the application state to initial state.

  • Performance issue with drop and re-create index

    My database table has about 2 million records. The index in the table was not optmized, so we created a new index lets call it index2. So this table now was the original index (index1) and the index2. We then inserted data into this table from the other box. It was running for a few weeks.
    Suddenly we noticed that a query which used to take a few seconds now took more than a minute. The execution plan was using the index2 which technically should be faster. We checked if the statistics were upto date and it was. So then we dropped the new index, re-ran the query and it completed in 10 sec's. It was usign the old index. This puzzled me since the point of the index2 was to make it better. So then we re-created index2 and genrated stats for the index. Re-ran the query and it completed in 5 sec's.
    Everytime we timed to run the query, I shutdown and restarted the box to clear all cache's. So all the time I have specified are pure time's and not cached. The execution plan using index2 taking 1 min and 5 sec's are nearly the same, with very minior difference in cost and cardnitality. Any ideas why index2 took 1 min before and after drop and create again takes only 5 sec.
    The reason I want to find the cause is to ensure that this doesn't happen again, since its impossible for me to re-create the index everytime I see this issue. Any thoughts would be helpful.

    Firstly the indexes are different index1 is only on the time column, where as index2 is a composite index consisting of 3 columns.
    Here are the details. The test that I did were last friday, 3/31. Yesterday and today when I executed the same query I get more increased times, yesterday it took 9 sec amd today 17 sec. The stats job kicked in on both days and is upto date. This table, nothing gets deleted. Only added.
    3/31
    Original
    Elapsed: 00:01:02.17
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6553 Card=9240 Bytes
    =203280)
    1 0 SORT (UNIQUE) (Cost=6553 Card=9240 Bytes=203280)
    2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
    UE) (Cost=15982 Card=2306303 Bytes=50738666)
    drop index EVENT_NA_TIME_ETYPE
    Elapsed: 00:00:11.91
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=7792 Card=9275 Bytes
    =204050)
    1 0 SORT (UNIQUE) (Cost=7792 Card=9275 Bytes=204050)
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'EVENT' (Cost=2092
    Card=2284254 Bytes=50253588)
    3 2 INDEX (RANGE SCAN) OF 'EVENT_TIME_NDX' (NON-UNIQUE
    ) (Cost=6740 Card=2284254)
    create index EVENT_NA_TIME_ETYPE ON EVENT(NET_ADDRESS,TIME,EVENT_TYPE);
    BEGIN
    SYS.DBMS_STATS.GENERATE_STATS('USER','EVENT_NA_TIME_ETYPE',0);
    end;
    Elapsed: 00:00:05.14
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6345 Card=9275 Bytes
    =204050)
    1 0 SORT (UNIQUE) (Cost=6345 Card=9275 Bytes=204050)
    2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
    UE) (Cost=12878 Card=2284254 Bytes=50253588)
    4/3
    Elapsed: 00:00:09.70
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6596 Card=9316 Bytes
    =204952)
    1 0 SORT (UNIQUE) (Cost=6596 Card=9316 Bytes=204952)
    2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
    UE) (Cost=11696 Card=2409400 Bytes=53006800)
    Statistics
    0 recursive calls
    0 db block gets
    11933 consistent gets
    9676 physical reads
    724 redo size
    467 bytes sent via SQL*Net to client
    503 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    3 rows processed
    4/4
    Elapsed: 00:00:17.99
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6681 Card=9421 Bytes
    =207262)
    1 0 SORT (UNIQUE) (Cost=6681 Card=9421 Bytes=207262)
    2 1 INDEX (FULL SCAN) OF 'EVENT_NA_TIME_ETYPE' (NON-UNIQ
    UE) (Cost=12110 Card=2433800 Bytes=53543600)
    Statistics
    0 recursive calls
    0 db block gets
    12279 consistent gets
    9423 physical reads
    2608 redo size
    467 bytes sent via SQL*Net to client
    503 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    3 rows processed
    SQL> select index_name,clustering_factor,blevel,leaf_blocks,distinct_keys from u ser_indexes where index_name like 'EVENT%';
    INDEX_NAME CLUSTERING_FACTOR BLEVEL LEAF_BLOCKS DISTINCT_KEYS
    EVENT_NA_TIME_ETYPE 2393170 2 12108 2395545
    EVENT_PK 32640 2 5313 2286158
    EVENT_TIME_NDX 35673 2 7075 2394055

  • Xcelsius 4.5 issue using QAAWS and Tomcat

    Hello,
    We have this issue where the dashboards do not display any data when opened. They are set to refresh on open.
    Only after the Tomcat webserver is restarted, then do they display data. But this keeps happenning often and intermitently.
    We do not get any error message, just a blank dashbaord. We are using QAAWS for connection.
    Any ideas why and resolution?
    Thanks

    Can this bug be addressed for 4.5?  Unfortunately, the changes I talked about above (to the TRUNC/TEXT order of operations) got around some calculation errors but not others, as more testing has shown.  For example,
    Scenario #1
    1.1. Multiply 3.00 * 3.30 = 9.900
    1.2. Convert 9.900 to text
    1.3. Truncate 9.900 to 9.90 <--- SUCCESS: Excel sees 9.90, Xcelsius sees 9.90
    Scenario #2
    2.1. Multiply 3.00 * 1.70 = 5.100
    2.2. Convert 5.100 to text
    2.3. Truncate 5.100 to 5.10 <--- ERROR: Excel sees 5.10, Xcelsius sees 5.09
    I'm out of ideas at the moment and am beginning to worry.

Maybe you are looking for

  • Home sharing questions....should I Share? Authorize?

    A bit confused about Home Sharing (just bought a 2nd gen AppleTV). We have two Macs in the apt - mine and my girlfriends. I can start up Home Sharing on the AppleTV (I used my iTunes account as the Home Sharing account), so I can see my Library. Now

  • Acrobat Toolbars gone haywire

    It seems my Acrobat toolbars in Word have developed a life of their own. the acrobat and the acrobat and acrobat meeting (never saw this one before) toolbars appear below my other toolbars everytime I bring a word window to the front. I can go into t

  • Is it possible to make several copy actions to a plan in COPA?

    Hi Experts, In COPA, we would like to copy actual data from last year to the planning we made for reference use. The user should then adjust these actual figures to plan data. Since we would like to copy contract data and invoice data (which was sent

  • Iphone 4S error 3194 when im trying to update to 6.1

    iphone 4S error 3194 when im trying to update to 6.1 in itunes why cant i update it? It says in tunes that the update is available

  • Lightbox Slideshow - Color shift

    I recently uploaded high res images to the Lightbox slideshow in Adobe Muse and updated the existing Adobe Muse site (www.marcmontocchio.com). When checking the slideshow I noticed that the coloring had changed versus what I originally uploaded. They