Performance of internal query

Every time i start a query in Discoverer Desktop (9.0.4) there starts an internal query to estimate how long my query takes.
The sql string is:
SELECT optimizer_cost cost
FROM v$sql sql, v$open_cursor csr, v$session ses
WHERE sql.hash_value = csr.hash_value
AND sql.address = csr.address
AND csr.sid = ses.sid
AND ses.audsid = userenv('SESSIONID')
AND sql.sql_text LIKE :thesql
ORDER BY sql.last_load_time
This internal query takes much longer than the real query!!
How can i prevent discoverer from executing this internal query or how can i tune this query?
Thanks in advance
Ole Behrens

Every time i start a query in Discoverer Desktop (9.0.4) there starts an internal query to estimate how long my query takes.
The sql string is:
SELECT optimizer_cost cost
FROM v$sql sql, v$open_cursor csr, v$session ses
WHERE sql.hash_value = csr.hash_value
AND sql.address = csr.address
AND csr.sid = ses.sid
AND ses.audsid = userenv('SESSIONID')
AND sql.sql_text LIKE :thesql
ORDER BY sql.last_load_time
This internal query takes much longer than the real query!!
How can i prevent discoverer from executing this internal query or how can i tune this query?
Thanks in advance
Ole Behrens

Similar Messages

  • CRM 2013 - Internal query related to fetching top 51 emails

    Hello All,
    We have recently upgraded from CRM 4 to CRM 2013. We are monitoring database server performance through one of the tool. We find that following internal query getting executed more frequently during initial business hours.
    (@ModifiedOn0 datetime,@PartyId0 uniqueidentifier)
    SELECT DISTINCT top 51 "email0".ModifiedOn as "modifiedon" ,  "email0".MessageId as "messageid" ,  "email0".ActivityId as "activityid" ,  "email0".RegardingObjectId
    as "regardingobjectid" ,  "email0".Subject as "subject" ,  "email0".RegardingObjectIdYomiName as "regardingobjectidyominame" ,     "email0".RegardingObjectIdName
    as "regardingobjectidname" ,     "email0".RegardingObjectTypeCode as "regardingobjecttypecode" 
    FROM Email as "email0"  JOIN ActivityParty as "activityparty1"  ON ("email0".ActivityId = "activityparty1".ActivityId 
    AND (("activityparty1".PartyId = @PartyId0))) 
    WHERE (( "email0".ModifiedOn >= @ModifiedOn0 
    AND "email0".MessageId is not null)) 
    ORDER BY "email0".MessageId asc , 
       "email0".ActivityId asc
    I found following useful blog which mentions the reason of frequent execution of this query.
    https://community.dynamics.com/crm/b/dynamicscrmsupportblog/archive/2012/10/11/crm-e-mail-tracking-part-3-tagging.aspx
    My question is,
    1) What will be impact if we disable email tagging option from all users? Note that, We are not using email router in our implementation.
    2) Will this query executes frequently during normal business hours also? If yes, then do we have any settings to change interval of execution of this process? 

    Hi ,
    Try to deactivate the Automatic E-Mail Tagging from Diagnostic Tool and observer the behaviour.
    If it still trigger then better to look for other areas.
    Regards
    Ayaz

  • Hpw to tune the performance of following query?

    Hi all,
               I want a particular set of G/L acct nos for the list of billing documents that i have in an internal table ie. pt_vbrk. I am using table BSIS.However ,when i use the following query it is taking  very very long time .I even tried using LOOP...ENDLOOP statement.Can anyone tell me how to enhance the performance of the query?Thanks in advance.
    i = 0.
    loop at pt_vbrk.
    i = i + 1.
    endloop.
    while j <= i.
    read table pt_vbrk index j.
    select single hkont  from bsis into  corresponding fields of
    pt_vbrk where
    ( hkont = '0013100000' or hkont = '0013105000'
    or hkont = '0013110000' or hkont = '0013112000'
    or hkont = '0013115000' or hkont = '0013120000'
    or hkont = '0013125000' or hkont = '0013135500'
    or hkont = '0013140000' or hkont = '0013145000'
    or hkont = '0013155000' or hkont = '0013165000'
    or hkont = '0013175000' or hkont = '0013170000' )
    and belnr = pt_vbrk-belnr and  gjahr = pt_vbrk-gjahr   . "#EC CI_NOFIRST
    modify pt_vbrk from pt_vbrk index j.
    j = j + 1.
    endwhile.
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on Sep 22, 2009 9:06 AM

    Try the following approach.
    TYPES: BEGIN OF ty_bsis,
             bukrs TYPE bsis-bukrs,
             hkont TYPE bsis-hkont,
             augdt TYPE bsis-augdt,
             augbl TYPE bsis-augbl,
             zuonr TYPE bsis-zuonr,
             gjahr TYPE bsis-gjahr,
             belnr TYPE bsis-belnr,
             buzei TYPE bsis-buzei,
           END OF ty_bsis.
    DATA: w_bsis     TYPE                 ty_bsis ,
          w_index    TYPE                 sy-tabix,
          t_bsis     TYPE SORTED TABLE OF ty_bsis
            WITH NON-UNIQUE KEY bukrs belnr gjahr ,
          t_vbrk_tmp LIKE        TABLE OF pt_vbrk .
    RANGES: r_hkont FOR bsis-hkont.
    IF NOT pt_vbrk[] IS INITIAL.
      REFRESH r_hkont.
      r_hkont-sign   = 'I'.
      r_hkont-option = 'EQ'.
      r_hkont-low = '0013100000'.
      APPEND r_hkont.
      r_hkont-low = '0013105000'.
      APPEND r_hkont.
      r_hkont-low = '0013110000'.
      APPEND r_hkont.
      r_hkont-low = '0013112000'.
      APPEND r_hkont.
      r_hkont-low = '0013115000'.
      APPEND r_hkont.
      r_hkont-low = '0013120000'.
      APPEND r_hkont.
      r_hkont-low = '0013125000'.
      APPEND r_hkont.
      r_hkont-low = '0013135500'.
      APPEND r_hkont.
      r_hkont-low = '0013140000'.
      APPEND r_hkont.
      r_hkont-low = '0013145000'.
      APPEND r_hkont.
      r_hkont-low = '0013155000'.
      APPEND r_hkont.
      r_hkont-low = '0013165000'.
      APPEND r_hkont.
      r_hkont-low = '0013175000'.
      APPEND r_hkont.
      r_hkont-low = '0013170000'.
      APPEND r_hkont.
      t_vbrk_tmp[] = pt_vbrk[].
      SORT t_vbrk_tmp BY bukrs gjahr belnr.
      DELETE ADJACENT DUPLICATES FROM t_vbrk_tmp
        COMPARING bukrs gjahr belnr.
      SELECT bukrs
             hkont
             augdt
             augbl
             zuonr
             gjahr
             belnr
             buzei
        FROM bsis
        INTO TABLE t_bsis
        FOR ALL ENTRIES IN t_vbrk_tmp
        WHERE bukrs EQ t_vbrk_tmp-bukrs
        AND   hkont IN r_hkont
        AND   gjahr EQ t_vbrk_tmp-gjahr
        AND   belnr EQ t_vbrk_tmp-belnr.
      IF sy-subrc EQ 0.
        LOOP AT pt_vbrk.
          w_index = sy-tabix.
          READ TABLE t_bsis INTO w_bsis
            WITH KEY bukrs = pt_vbrk-bukrs
                     belnr = pt_vbrk-belnr
                     gjahr = pt_vbrk-gjahr
                     TRANSPORTING
                       hkont.
          IF sy-subrc EQ 0.
            pt_vbrk-hkont = w_bsis-hkont.
            MODIFY pt_vbrk INDEX w_index
              TRANSPORTING
                hkont.
          ENDIF.
        ENDIF.
      ENDIF.

  • How to clear Internal Query Processor Error

    "An unexpected error occured while storing this sales order! Internal Query Processor Error: The query processor excountered an unexpected error during execution.

    Can you show the query? Also, I would run DBCC CHECKDB on the database,  does it return errors?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Please help me to increase the performance of the query

    Hello
    I am not an oracle expert or developer and i have a problem to resolve.
    Below is the query and explaiation plan and seeking the help to improve the performance of the query.
    Our Analysis,
    The query runs good,takes less one minute and fetches the results but during peak time it takes 8 minutes
    Require anyone suggestion's to improve the query.
    The query is generated from the Microsft dll so we dont have SQL code and require some help on tuning the tables.
    If tuning the query improves then also fine please suggest for that also.
    Enviroment: Solaris 8
    DB : oracle 9i
    (SELECT vw.dispapptobjid, vw.custsiteobjid, vw.emplastname, vw.empfirstname,
    vw.scheduledonsite AS starttime, vw.appttype, vw.latestart,
    vw.endtime, vw.typetitle, vw.empobjid, vw.latitude, vw.longitude,
    vw.workduration AS DURATION, vw.dispatchtype, vw.availability
    FROM ora_appt_disp_view vw
    WHERE ( ( vw.starttime >=
    TO_DATE ('2/12/2007 4:59 PM', 'MM/DD/YYYY HH12:MI AM')
    AND vw.starttime <
    TO_DATE ('2/21/2007 3:59 PM', 'MM/DD/YYYY HH12:MI AM')
    OR vw.endtime >
    TO_DATE ('2/12/2007 4:59 PM', 'MM/DD/YYYY HH12:MI AM')
    AND vw.endtime <=
    TO_DATE ('2/21/2007 3:59 PM', 'MM/DD/YYYY HH12:MI AM')
    OR ( vw.starttime <=
    TO_DATE ('2/12/2007 4:59 PM', 'MM/DD/YYYY HH12:MI AM')
    AND vw.endtime >=
    TO_DATE ('2/21/2007 3:59 PM', 'MM/DD/YYYY HH12:MI AM')
    UNION
    (SELECT 0 AS dispapptobjid, emp.emp_physical_site2site AS custsiteobjid,
    emp.last_name AS emplastname, emp.first_name AS empfirstname,
    TO_DATE ('1/1/3000', 'MM/DD/YYYY') AS starttime, 'E' AS appttype,
    NULL AS latestart, NULL AS endtime, '' AS typetitle,
    emp.objid AS empobjid, 0 AS latitude, 0 AS longitude, 0 AS DURATION,
    '' AS dispatchtype, 0 AS availability
    FROM table_employee emp, table_user usr
    WHERE emp.employee2user = usr.objid AND emp.field_eng = 1 AND usr.status = 1)
    ORDER BY empobjid, starttime, endtime DESC
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=HINT: ALL_ROWS          23 K          11312                     
    SORT UNIQUE          23 K     3 M     11140                     
    UNION-ALL                                        
    VIEW     ORA_APPT_DISP_VIEW     17 K     3 M     10485                     
    UNION-ALL                                        
    CONCATENATION                                        
    NESTED LOOPS OUTER          68      24 K     437                     
    NESTED LOOPS          68      23 K     369                     
    NESTED LOOPS OUTER          68      25 K     505                     
    NESTED LOOPS OUTER          68      24 K     505                     
    NESTED LOOPS          68      23 K     369                     
    NESTED LOOPS          68      22 K     369                     
    NESTED LOOPS OUTER          68      22 K     369                     
    NESTED LOOPS          19      6 K     312                     
    NESTED LOOPS          19      5 K     312                     
    HASH JOIN          19      5 K     293                     
    NESTED LOOPS          19      5 K     274                     
    NESTED LOOPS          19      4 K     236                     
    NESTED LOOPS          19      4 K     198                     
    NESTED LOOPS OUTER          19      3 K     160                     
    NESTED LOOPS OUTER          19      3 K     160                     
    NESTED LOOPS OUTER          19      4 K     160                     
    NESTED LOOPS OUTER          19      1 K     103                     
    NESTED LOOPS OUTER          19      2 K     103                     
    NESTED LOOPS OUTER          19      2 K     103                     
    TABLE ACCESS BY INDEX ROWID     TABLE_DISPTCHFE     19      1 K     46                     
    INDEX RANGE SCAN     GSA_SCHED_REPAIR     44           3                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22                          
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22                          
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22      3                     
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28                          
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28                          
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28      3                     
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_CASE     1      30      2                     
    INDEX UNIQUE SCAN     CASE_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_SITE     1      12      2                     
    INDEX UNIQUE SCAN     SITE_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_ADDRESS     1      12      2                     
    INDEX UNIQUE SCAN     ADDRESS_OBJINDEX     1           1                     
    TABLE ACCESS FULL     TABLE_EMPLOYEE     1      34      1                     
    INDEX UNIQUE SCAN     SITE_OBJINDEX     1      6      1                     
    INDEX UNIQUE SCAN     USER_OBJINDEX     1      6                          
    TABLE ACCESS BY INDEX ROWID     TABLE_X_GSA_TIME_STAMPS     4      48      3                     
    INDEX RANGE SCAN     GSAIDX_TS2DISP     1           2                     
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    TABLE ACCESS BY INDEX ROWID     TABLE_MOD_LEVEL     1      12      1                     
    INDEX UNIQUE SCAN     MOD_LEVEL_OBJINDEX     1                               
    INDEX UNIQUE SCAN     PART_NUM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     SUBCASE_OBJINDX     1      6      1                     
    NESTED LOOPS OUTER          68      25 K     505                     
    NESTED LOOPS OUTER          68      24 K     505                     
    NESTED LOOPS OUTER          68      24 K     437                     
    NESTED LOOPS          68      23 K     369                     
    NESTED LOOPS          68      23 K     369                     
    NESTED LOOPS          68      22 K     369                     
    NESTED LOOPS OUTER          68      22 K     369                     
    NESTED LOOPS          19      6 K     312                     
    NESTED LOOPS          19      5 K     312                     
    NESTED LOOPS          19      5 K     293                     
    NESTED LOOPS          19      5 K     274                     
    NESTED LOOPS          19      4 K     236                     
    NESTED LOOPS          19      4 K     198                     
    NESTED LOOPS OUTER          19      4 K     160                     
    NESTED LOOPS OUTER          19      3 K     160                     
    NESTED LOOPS OUTER          19      3 K     160                     
    NESTED LOOPS OUTER          19      2 K     103                     
    NESTED LOOPS OUTER          19      2 K     103                     
    NESTED LOOPS OUTER          19      1 K     103                     
    TABLE ACCESS BY INDEX ROWID     TABLE_DISPTCHFE     19      1 K     46                     
    INDEX RANGE SCAN     GSA_SCHED_REPAIR     44           3                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22      3                     
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22                          
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22                          
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28      3                     
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28                          
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28                          
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_CASE     1      30      2                     
    INDEX UNIQUE SCAN     CASE_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_SITE     1      12      2                     
    INDEX UNIQUE SCAN     SITE_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_ADDRESS     1      12      2                     
    INDEX UNIQUE SCAN     ADDRESS_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_EMPLOYEE     1      34      1                     
    INDEX UNIQUE SCAN     EMPLOYEE_OBJINDEX     1                               
    INDEX UNIQUE SCAN     SITE_OBJINDEX     1      6      1                     
    INDEX UNIQUE SCAN     USER_OBJINDEX     1      6                          
    TABLE ACCESS BY INDEX ROWID     TABLE_X_GSA_TIME_STAMPS     4      48      3                     
    INDEX RANGE SCAN     GSAIDX_TS2DISP     1           2                     
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     SUBCASE_OBJINDX     1      6      1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_MOD_LEVEL     1      12      1                     
    INDEX UNIQUE SCAN     MOD_LEVEL_OBJINDEX     1                               
    INDEX UNIQUE SCAN     PART_NUM_OBJINDEX     1      6                          
    NESTED LOOPS OUTER          68      25 K     505                     
    NESTED LOOPS OUTER          68      24 K     505                     
    NESTED LOOPS OUTER          68      24 K     437                     
    NESTED LOOPS          68      23 K     369                     
    NESTED LOOPS          68      23 K     369                     
    NESTED LOOPS          68      22 K     369                     
    NESTED LOOPS OUTER          68      22 K     369                     
    NESTED LOOPS          19      6 K     312                     
    NESTED LOOPS          19      5 K     312                     
    NESTED LOOPS          19      5 K     293                     
    NESTED LOOPS          19      5 K     274                     
    NESTED LOOPS          19      4 K     236                     
    NESTED LOOPS          19      4 K     198                     
    NESTED LOOPS OUTER          19      4 K     160                     
    NESTED LOOPS OUTER          19      3 K     160                     
    NESTED LOOPS OUTER          19      3 K     160                     
    NESTED LOOPS OUTER          19      2 K     103                     
    NESTED LOOPS OUTER          19      2 K     103                     
    NESTED LOOPS OUTER          19      1 K     103                     
    TABLE ACCESS BY INDEX ROWID     TABLE_DISPTCHFE     19      1 K     46                     
    INDEX RANGE SCAN     GSA_REQ_ETA     44           3                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22      3                     
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22                          
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      22                          
    INDEX RANGE SCAN     GSA_COMDFE     1           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28      3                     
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28                          
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_COMMIT_LOG     1      28                          
    INDEX RANGE SCAN     IND_CASE_COMMIT2CASE     2           2                     
    TABLE ACCESS BY INDEX ROWID     TABLE_CASE     1      30      2                     
    INDEX UNIQUE SCAN     CASE_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_SITE     1      12      2                     
    INDEX UNIQUE SCAN     SITE_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_ADDRESS     1      12      2                     
    INDEX UNIQUE SCAN     ADDRESS_OBJINDEX     1           1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_EMPLOYEE     1      34      1                     
    INDEX UNIQUE SCAN     EMPLOYEE_OBJINDEX     1                               
    INDEX UNIQUE SCAN     SITE_OBJINDEX     1      6      1                     
    INDEX UNIQUE SCAN     USER_OBJINDEX     1      6                          
    TABLE ACCESS BY INDEX ROWID     TABLE_X_GSA_TIME_STAMPS     4      48      3                     
    INDEX RANGE SCAN     GSAIDX_TS2DISP     1           2                     
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     GBST_ELM_OBJINDEX     1      6                          
    INDEX UNIQUE SCAN     SUBCASE_OBJINDX     1      6      1                     
    TABLE ACCESS BY INDEX ROWID     TABLE_MOD_LEVEL     1      12      1                     
    INDEX UNIQUE SCAN     MOD_LEVEL_OBJINDEX     1                               
    INDEX UNIQUE SCAN     PART_NUM_OBJINDEX     1      6                          
    NESTED LOOPS          16 K     2 M     5812                     
    HASH JOIN          16 K     2 M     5812                     
    HASH JOIN          16 K     2 M     5286                     
    TABLE ACCESS FULL     TABLE_EMPLOYEE     13 K     441 K     28                     
    HASH JOIN          16 K     1 M     5243                     
    TABLE ACCESS FULL     TABLE_SCHEDULE     991      11 K     2                     
    HASH JOIN OUTER          16 K     1 M     5240                     
    HASH JOIN OUTER          16 K     1 M     3866                     
    HASH JOIN OUTER          16 K     1 M     450                     
    HASH JOIN          16 K     1 M     44                     
    TABLE ACCESS FULL     TABLE_GBST_ELM     781      14 K     2                     
    TABLE ACCESS FULL     TABLE_APPOINTMENT     16 K     822 K     41                     
    INDEX FAST FULL SCAN     CASE_OBJINDEX     1 M     6 M     201                     
    TABLE ACCESS FULL     TABLE_SITE     967 K     11 M     3157                     
    TABLE ACCESS FULL     TABLE_ADDRESS     961 K     11 M     1081                     
    INDEX FAST FULL SCAN     SITE_OBJINDEX     967 K     5 M     221                     
    INDEX UNIQUE SCAN     USER_OBJINDEX     1      6                          
    HASH JOIN          6 K     272 K     51                     
    TABLE ACCESS FULL     TABLE_USER     6 K     51 K     21                     
    TABLE ACCESS FULL     TABLE_EMPLOYEE     6 K     220 K     28

    Hi,
    First-off, it appear that you are querying a view. I would redo the auery against the base table.
    Next, look at a function-based index for the DATE column. Here are my notes:
    http://www.dba-oracle.com/t_function_based_indexes.htm
    http://www.dba-oracle.com/oracle_tips_index_scan_fbi_sql.htm
    Also, make sure you are analyzed properly with dbms_stats:
    http://www.dba-oracle.com/art_builder_dbms_stats.htm
    And histograms, if appropriate:
    http://www.dba-oracle.com/art_builder_histo.htm
    Lasty, look at increasing hash_area_size or pga_aggregate_tagtet, depending on your table sizes:
    http://www.dba-oracle.com/art_so_undocumented_pga_parameters.htm
    Hope this helps. . . .
    Donald K. Burleson
    Oracle Press Author

  • Bad performance of af:query

    I am working on Oracle Jdeveloper 11g Release 1
    I have a VO which gets executed when the first page gets loaded. suppose the VO is RuleLibraryVO
    I have a view criteria RuleLibraryVOCriteria in the VO which is used in the af:query panel in the page.
    When i do search for any attribute using the query panel the VO gets executed again everytime even if the VO is in the memory. This is hampering the performance of my query panel as it is again calling getters for all 2000+ rows and then searching. The VO Criteria used is:
    <ViewCriteria
        Name="RuleLibraryVOCriteria"
        ViewObjectName="oracle.sysman.core.gccompliance.model.library.rule.view.RuleLibraryVO"
        Conjunction="AND"
        Mode="3">
        <Properties>
          <CustomProperties>
            <Property
              Name="displayOperators"
              Value="InAdvancedMode"/>
            <Property
              Name="autoExecute"
              Value="true"/>
            <Property
              Name="allowConjunctionOverride"
              Value="true"/>
            <Property
              Name="showInList"
              Value="false"/>
            <Property
              Name="mode"
              Value="Basic"/>
            <Property
              Name="displayName"
              ResId="DEFAULT_SEARCH"/>
          </CustomProperties>
        </Properties>
        <ViewCriteriaRow
          Name="vcrow3"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="RuleDnameTransient"
            ViewAttribute="RuleDnameTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional">
            <CompOper
              Name="LessThan"
              ToDo="-1"
              Oper="&lt;"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="LessThanOrEqualTo"
              ToDo="-1"
              Oper="&lt;="
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThan"
              ToDo="-1"
              Oper=">"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThanOrEqualTo"
              ToDo="-1"
              Oper=">="
              MinCardinality="0"
              MaxCardinality="0"/>
          </ViewCriteriaItem>
          <ViewCriteriaItem
            Name="DescriptionTransient"
            ViewAttribute="DescriptionTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional">
            <CompOper
              Name="LessThan"
              ToDo="-1"
              Oper="&lt;"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="LessThanOrEqualTo"
              ToDo="-1"
              Oper="&lt;="
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThan"
              ToDo="-1"
              Oper=">"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThanOrEqualTo"
              ToDo="-1"
              Oper=">="
              MinCardinality="0"
              MaxCardinality="0"/>
          </ViewCriteriaItem>
          <ViewCriteriaItem
            Name="IsSystem"
            ViewAttribute="IsSystem"
            Operator="="
            Conjunction="AND"
            Required="Optional"/>
          <ViewCriteriaItem
            Name="RuleType"
            ViewAttribute="RuleType"
            Operator="="
            Conjunction="AND"
            Required="Optional"/>
          <ViewCriteriaItem
            Name="TargetType"
            ViewAttribute="TargetType"
            Operator="="
            Conjunction="AND"
            Required="Optional"
            Value=":targetType"
            IsBindVarValue="true"/>
          <ViewCriteriaItem
            Name="KeywordsTransient"
            ViewAttribute="KeywordsTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional"/>
        </ViewCriteriaRow>
      </ViewCriteria>The query panel in jspx is:
    <af:query id="qryId2"
                      headerText="#{coregccomplianceuiBundle.COMPLIANCE_SEARCH}"
                      disclosed="false"
                      value="#{bindings.RuleLibraryVOCriteriaQuery.queryDescriptor}"
                      model="#{bindings.RuleLibraryVOCriteriaQuery.queryModel}"
                      queryListener="#{bindings.RuleLibraryVOCriteriaQuery.processQuery}"
                      queryOperationListener="#{bindings.RuleLibraryVOCriteriaQuery.processQueryOperation}"
                      resultComponentId="::pc1:ruleLib" rows="3" maxColumns="2"
                      saveQueryMode="hidden"/>How can i optimize the search behavior so that it only searches using the vo data already loaded in memory.

    Hi Frank,
    Thanks for quick response,
    As suggested i made the Query Execution Mode to - In-Memory. And my view criteria now is:
    <ViewCriteria
        Name="RuleLibraryVOCriteria"
        ViewObjectName="oracle.sysman.core.gccompliance.model.library.rule.view.RuleLibraryVO"
        Conjunction="AND"
        Mode="2">
        <Properties>
          <CustomProperties>
            <Property
              Name="displayOperators"
              Value="InAdvancedMode"/>
            <Property
              Name="autoExecute"
              Value="true"/>
            <Property
              Name="allowConjunctionOverride"
              Value="true"/>
            <Property
              Name="showInList"
              Value="false"/>
            <Property
              Name="mode"
              Value="Basic"/>
            <Property
              Name="displayName"
              ResId="DEFAULT_SEARCH"/>
          </CustomProperties>
        </Properties>
        <ViewCriteriaRow
          Name="vcrow3"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="RuleDnameTransient"
            ViewAttribute="RuleDnameTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional">
            <CompOper
              Name="LessThan"
              ToDo="-1"
              Oper="&lt;"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="LessThanOrEqualTo"
              ToDo="-1"
              Oper="&lt;="
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThan"
              ToDo="-1"
              Oper=">"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThanOrEqualTo"
              ToDo="-1"
              Oper=">="
              MinCardinality="0"
              MaxCardinality="0"/>
          </ViewCriteriaItem>
          <ViewCriteriaItem
            Name="DescriptionTransient"
            ViewAttribute="DescriptionTransient"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional">
            <CompOper
              Name="LessThan"
              ToDo="-1"
              Oper="&lt;"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="LessThanOrEqualTo"
              ToDo="-1"
              Oper="&lt;="
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThan"
              ToDo="-1"
              Oper=">"
              MinCardinality="0"
              MaxCardinality="0"/>
            <CompOper
              Name="GreaterThanOrEqualTo"
              ToDo="-1"
              Oper=">="
              MinCardinality="0"
              MaxCardinality="0"/>
          </ViewCriteriaItem>
          <ViewCriteriaItem
            Name="IsSystem"
            ViewAttribute="IsSystem"
            Operator="="
            Conjunction="AND"
            Required="Optional"/>
          <ViewCriteriaItem
            Name="RuleType"
            ViewAttribute="RuleType"
            Operator="="
            Conjunction="AND"
            Required="Optional"/>
          <ViewCriteriaItem
            Name="TargetType"
            ViewAttribute="TargetType"
            Operator="="
            Conjunction="AND"
            Required="Optional"
            Value=":targetType"
            IsBindVarValue="true"/>
          <ViewCriteriaItem
            Name="KeywordsTransient"
            ViewAttribute="*KeywordsTransient*"
            Operator="CONTAINS"
            Conjunction="AND"
            Required="Optional"
            UpperColumns="0"/>
        </ViewCriteriaRow>
      </ViewCriteria>
      The performance hit is when i search for attribute: KeywordsTransient.
    The attribute is as :
      <ViewAttribute
        Name="KeywordsTransient"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="VIEW_ATTR"
        SQLType="VARCHAR">
        <RecalcCondition><![CDATA[return (adf.object.isAttributeChanged("Keywords")]]></RecalcCondition>
        <TransientExpression><![CDATA[object.Keywords]]></TransientExpression>
        <Dependencies>
          <Item
            Value="Keywords"/>
        </Dependencies>
        <Properties>
          <SchemaBasedProperties>
            <LABEL
              ResId="KEYWORDS"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>
      This attribute is dependent on Keywords attribute of the VO , The keyword getter is as below:
         * Gets the attribute value for the calculated attribute Keywords.
         * @return the Keywords
        public String getKeywords() {
            if (((String) getAttributeInternal(KEYWORDS)) == null)
                        long startTime = System.currentTimeMillis();
                        String keyword = "";
                        CSRUtil csrUtil = new CSRUtil();
                       // get the keyword name list from RuleKeywordTableVO which stores ruleGuid to KeywordName mapping. This VO is Loaded in memory as soon as bean initailizes.
                        Set<String> keywordList =
                            csrUtil.getRuleKeywordListFromKeywordMapVO(getRuleGuid());
                        if (keywordList != null)
                            Iterator rowIter = keywordList.iterator();
                            while (rowIter.hasNext())
                                keyword =
                                        keyword.concat(csrUtil.getKeywordNlsIdFromTable((String) rowIter.next())) +
                        if (keyword.endsWith(", "))
                            keyword = keyword.substring(0, keyword.length() - 2);
                        setKeywords(keyword);
                        setKeywordsTransient(keyword);
                        long endTime = System.currentTimeMillis();
                        logger.severe("Time taken for this rule in millis : "+ (endTime-startTime));
                    return (String) getAttributeInternal(KEYWORDS);
      This getter is creating keyword list using nlsid translation based on other tables data for a rule.
    Also, I have loaded the rule vo data in memory using invokeAction on my page as below:
        <invokeAction id="ExecuteRuleInvoke" Binds="ExecuteRULE"
                      Refresh="renderModel" RefreshCondition="#{sdk_core_uifwk_refresh_ctrl.executeNeeded}"/>
         <action IterBinding="RuleLibraryVO1Iterator" id="ExecuteRULE"
                InstanceName="ComplianceLibraryAMDataControl.RuleLibraryVO1"
                DataControl="ComplianceLibraryAMDataControl"
                RequiresUpdateModel="true" Action="iteratorExecute"/>
      So now when i search for a keywordTransient attribute using query panel the getter is always called for keywords even if the VO data is in memory.
    So what am i missing, is the data loaded by invokeAction not visible to the query, or i have to use some other optimization.

  • Performance of my query based on cube ? and ods?

    hi all,
    how to identify the performance of my query based on a cube nor ods. I have requirement which enables to do flat file extraction and the extraction is only once and the records are less too. I need to sort whether my query will be faster based upon cube nor on ods.
    Can anyone let me know how to measure the performance of my query based upon cube and ods and how to find out which one will be faster. bcos i need to explain them the entire process of going to load the data directly to ods and do reporting from there nor data loaded directly to cube and do reporting from cube.
    thanxs
    haritha

    Hi,
    ODS is 2 Dimensional  so avoid reporting on ODS,
    Cube is MultiDim, for analysis perpose we can go reporting on Cube only
    Records in ODS are Overwritten whereas in Cube records are Aggregated
    and can also do compression on Cube, which will increase the query performance and so data retrieval in cube is faster
    Thanks

  • Need help in optimising the performance of a query

    Need help in optimising the performance of a query. Below is the query that is executed on TABLE_A, TABLE_B and TABLE_C with record counts as 10M, 10m and 42 (only) respectively and it takes around 5-7 minutes to get 40 records:
    SELECT DISTINCT a.T_ID_, a.FIRSTNAME, b.T_CODE, b.PRODUCT,
    CASE WHEN TRUNC(b.DATE) +90 = TRUNC(SYSDATE) THEN -90 WHEN TRUNC(b.DATE) +30 = TRUNC(SYSDATE) THEN -30 ELSE 0 END AS T_DATE FROM TABLE_B b
    INNER JOIN TABLE_A a ON (a.T_ID_ = b.T_ID_) LEFT JOIN TABLE_C c ON b.PRODUCT = c.PRODUCT
    WHERE b.STATUS = 'T' AND (b.TYPE = 'ACTION'
    AND ( TRUNC(b.DATE) + 1 = TRUNC(SYSDATE) ) ) AND b.PRODUCT = 2;
    Note: Indices on the join columns are available in the respective tables
    Please let me know if there is any better way to write it.
    Edited by: 862944 on Aug 18, 2011 9:52 AM

    862944 wrote:
    Need help in optimising the performance of a query. Below is the query that is executed on TABLE_A, TABLE_B and TABLE_C with record counts as 10M, 10m and 42 (only) respectively and it takes around 5-7 minutes to get 40 records:
    SELECT DISTINCT a.T_ID_, a.FIRSTNAME, b.T_CODE, b.PRODUCT,
    CASE WHEN TRUNC(b.DATE) +90 = TRUNC(SYSDATE) THEN -90 WHEN TRUNC(b.DATE) +30 = TRUNC(SYSDATE) THEN -30 ELSE 0 END AS T_DATE FROM TABLE_B b
    INNER JOIN TABLE_A a ON (a.T_ID_ = b.T_ID_) LEFT JOIN TABLE_C c ON b.PRODUCT = c.PRODUCT
    WHERE b.STATUS = 'T' AND (b.TYPE = 'ACTION'
    AND ( TRUNC(b.DATE) + 1 = TRUNC(SYSDATE) ) ) AND b.PRODUCT = 2;
    Note: Indices on the join columns are available in the respective tables
    Please let me know if there is any better way to write it.
    Edited by: 862944 on Aug 18, 2011 9:52 AM[When Your Query Takes Too Long|https://forums.oracle.com/forums/thread.jspa?messageID=1812597]

  • How to improve the performance of the query

    Hi,
    Help me by giving tips how to improve the performance of the query. Can I post the query?
    Suresh

    Below is the formatted query and no wonder it is taking lot of time. Will give you a list of issues soon after analyzing more. Till then understand the pitfalls yourself from this formatted query.
    SELECT rt.awb_number,
           ar.activity_id as task_id,
           t.assignee_org_unit_id,
           t.task_type_code,
           ar.request_id
    FROM activity_task ar,
         request_task rt,
         task t
    WHERE ar.activity_id =t.task_id
    AND ar.request_id = rt.request_id
    AND ar.complete_status != 'act.stat.closed'
    AND t.assignee_org_unit_id in (SELECT org_unit_id
                                   FROM org_unit
                                   WHERE org_unit_id in (SELECT oo.org_unit_id
                                                         FROM org_unit oo
                                                         WHERE oo.org_unit_id='3'
                                                         OR oo.parent_id ='3'
                                   OR parent_id in (SELECT oo.org_unit_id
                                                    FROM org_unit oo
                                                    WHERE oo.org_unit_id='3'
                                                    OR oo.parent_id ='3'
                                   AND has_queue=1
    AND ar.parent_task_id not in (SELECT tt.task_id
                                  FROM task tt
                                  WHERE tt.assignee_org_unit_id in (SELECT org_unit_id
                                                                    FROM org_unit
                                                                    WHERE org_unit_id in (SELECT oo.org_unit_id
                                                                                          FROM org_unit oo
                                                                                          WHERE oo.org_unit_id='3'
                                                                                          OR oo.parent_id ='3'
                                                                     OR parent_id in (SELECT oo.org_unit_id
                                                                                      FROM org_unit oo     
                                                                                      WHERE oo.org_unit_id='3'
                                                                                      OR oo.parent_id ='3'
                                                                     AND has_queue=1
    AND rt.awb_number is not null
    ORDER BY rt.awb_numberCheers
    Sarma.

  • HI All, How to improve the performance in given query?

    HI All,
    How to improve the performance in given query?
    Query is..
    PARAMETERS : p_vbeln type lips-vbeln.
    DATA : par_charg TYPE LIPS-CHARG,
    par_werks TYPE LIPS-WERKS,
    PAR_MBLNR TYPE MSEG-MBLNR .
    SELECT SINGLE charg
    werks
    INTO (par_charg, par_werks)
    FROM lips
    WHERE vbeln = p_vbeln.
    IF par_charg IS NOT INITIAL.
    SELECT single max( mblnr )
    INTO par_mblnr
    FROM mseg
    WHERE bwart EQ '101'
    AND werks EQ par_werks (index on werks only)
    AND charg EQ par_charg.
    ENDIF.
    Regards
    Steve

    Hi steve,
    Can't you use the material in your query (and not only the batch)?
    I am assuming your system has an index MSEG~M by MANDT + MATNR + WERKS (+ other fields). Depending on your system (how many different materials you have), this will probably speed up the query considerably.
    Anyway, in our system we ended up by creating an index by CHARG, but leave as a last option, only if selecting by matnr and werks is not good enough for your scenario.
    Hope this helps,
    Rui Dantas

  • Please help me how to improve the performance of this query further.

    Hi All,
    Please help me how to improve the performance of this query further.
    Thanks.

    Hi,
    this is not your first SQL tuning request in this community -- you really should learn how to obtain performance diagnostics.
    The information you posted is not nearly enough to even start troubleshooting the query -- you haven't specified elapsed time, I/O, or the actual number of rows the query returns.
    The only piece of information we have is saying that your query executes within a second. If we believe this, then your query doesn't need tuning. If we don't, then we throw it away
    and we're left with nothing.
    Start by reading this blog post: Kyle Hailey &amp;raquo; Power of DISPLAY_CURSOR
    and applying this knowledge to your case.
    Best regards,
      Nikolay

  • Internal query that is used during the message search from EMC

    Hi,
    We have a requirement where in we need to identify the internal query that is executed ( since there were few mails that are being deleted at production instance, so want to know the details) when we search for the data from the following navigation:
    Oracle Email Center -> Messages -> Search.
    Could you please help us out in knowing the exact query as early as possible as it is of high priority.

    Thanks for your input.
    Let me explain how we solved our problem in brief:
    - We have created a new infobject for item number with 5 digits
    - We added this to the key in DEV system
    - We created a copy of the active table how it would look like after transport on DB level
    - We copied data 380 million records into the new table on DB level
    - We renmade the active table to xxx_old to have a back-up and then re-created an empty active table via SE14
    - We imported the transport when all 3 DSO tables were empty, which was very fast
    - We dropped the empty active table
    - We renamed the copy of the active table to carry the name of the active table
    During this process we ensured beforehand that SIDs are available for the new IOBJ. We also filled the new IOBJ by copying the values from the 3-digit IOBJ.
    All went well.

  • Performance of the query

    Hello Guys,
             iam having performance problem with query .when i run the the query with intial variables its displaying report quickly but when i go drilling with filter values its taking 10 minutes to display report.can anybody suggest me possible solutions for the performance improvement.
    Regards
    Priya

    Hi Priya,
    First, you have to check what is causing the performance issue. You can do this by running the query in transaction RSRT. Execute the query in debug mode with the option "Display Statistics Data". You can navigate the query as you would normally. After that, check the statistics information and see what causes the performance issue. My guess is that you need to build an aggregate.
    If rhe Data Manager time is high (a large % of the total runtime) and the ratio of the number of records selected VS the number of records transfered is high (e.g. > 10), then try to build an aggregate to help on the performance. To check for aggregate suggestions, run RSRT again with the option "Display Aggregates Found". It will show you what characteristics and characteristics selections would help (note that the suggestion might not always be the optimal one).
    If OLAP Data Transfer time is high, then try optimizing the query design (e.g. try reducing the amount of restricted KFs or try calculating some KFs during the data flow instead of calculating them in the query).
    Hope this helps.

  • Performance of the query is poor

    Hi All,
    This is Prasad.  I have a problem with the query it is taking more time to retrieve the data from the Cube.  In the query they are using a Variable of type Customer Exit.   The Cube is not at compressed.  I think the issue with the F fact table is due to the high number of table partitions (requests) that it has to select from. If I compress the cube, the performance of the query is increased r not?  Is there any alternative for improving the performance of the query.  Somebody suggested Result set query, iam not aware of this technique if u know let me know.
    Thanks in advance

    Hi Prasad,
    Query performance will depend on many factors like
    1. Aggregates
    2. Compression of requests
    3. Query read mode setting
    4. Cache memory setting
    5. By Creating BI Accelerator Indexes on Infocubes
    6. Indexes
    Proposing aggregates to improve query performance:
    First try to execute the query in RSRT on which u required to build aggregates. Check how much time it is taking to execute.....and whether it is required to build aggregate on this querry?? To get this information, Goto SE11> Give tabl name RSDDSTAT_DM in BI7.0 or RSDDSTAT in BW3.x.> Disply -> Contnts-> Give from date and to date values as today, user name as Ur user name, and give the query name
    --> execute.
    Now u'll get a list with fields like Object anme(Report anme), Time read, Infoprovider name(Multiprovider), Partprovider name (Cube), Aggregate name... etc. If the time read is less than 100,000,000 (100 sec) is acceptable. If the time read is more than 100 sec then it is recommended to create Aggregates for that query to increase performance. Keep in mind this time read.
    Again goto RSRT> Give query name> Execute+Debug-->
    A popup will come in that select the check box display aggregates found--> continue. If any aggregates or exist for that
    query it will display first if u press on continue button, it will display from which cube which fields are coming it will display...try to copy this list of objects on which aggregate can be created into one text file...
    then select that particular cube in RSA1>context>Maintain Aggregates-> Create by own> click on create aggregate button on top left side> Give discription of the aggregate>continue> take first object from list and fclick on find button in aggregates creation screen> give the object name and search... drag and drop that object into aggregate name right side (Drag and drop all the fields like this into aggregate).---->
    Activate the aggregate--> it will take some time once the activation finishes --> make sure that aggregate is in switch on mode.
    Try to xecute the query from RSRT again and find out the time read and compare this with first time read. If it is less tahn first time read then u can propose this aggregate to incraese the performance of the query.
    I hope this will help u... go through the below links to know about aggregates more clear.
    http://help.sap.com/saphelp_nw04s/helpdata/en/10/244538780fc80de10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
    Follow this thread for creation of BIA Indexes:
    Re: BIA Creation
    Hopr this helps...
    Regards,
    Ramki.

  • Performance of sap query

    Hi All
    I have one SAP query which collects data from VBRK, VBUK, VBPA,, VBRP, VBFA and KONV tables.
    Some times it is taking a lot of time.
    How can I improve the performance of this query.

    hi,
    You can get by using the JOIN's in the query, please take care of these
    1, promary index and secondary index.
    2, don't join all the table, split them into different queries..bu using FOR ALL ENTRIES
    3. give where conditions as many as possible..
    4. Sort the result finally..
    hope this will help u.
    Pradeep

Maybe you are looking for