The query which runs in 1 minute in oracle 8 takes hours in oracle 10.

I have a query which takes longer time in oracle 10. I have looked at the parameters and it all seems to be right. I dont know what other parameter has to be changed in order to make it work. The strange thing is that if I addr another criteriain the where clause then the sql runs in less than one minute. I added AND J.DEPTID Between '00000' and '99999' in the where class which is not really required as without that also the query returns data for all depts as the dept number falls between 00000 and 99999. Following is the sql which takes long time to run.
SELECT
L.HRS_ADJUST_UNPROC,L.HRS_ADJUST_YTD,L.HRS_CARRYOVER,J.DEPTID,L.COMPANY, L.EMPLID, J.HOURLY_RT, P.NAME
FROM
PS_LEAVE_ACCRUAL L, PS_JOB J, PS_LOCATION_TBL LOC, PS_PERSONAL_DATA P
WHERE
(((L.PLAN_TYPE = '50') AND
(L.ACCRUAL_PROC_DT = (SELECT MAX(L2.ACCRUAL_PROC_DT)
FROM PS_LEAVE_ACCRUAL L2
WHERE L2.EMPLID=L.EMPLID
AND L2.EMPL_RCD_NBR=L.EMPL_RCD_NBR
AND L2.PLAN_TYPE=L.PLAN_TYPE)) AND
(J.EMPL_STATUS IN( 'A', 'L', 'P')) AND
((L.HRS_ADJUST_UNPROC+L.HRS_ADJUST_YTD+L.HRS_CARRYOVER+L.HRS_EARNED_YTD-L.HRS_TAKEN_UNPROC-L.HRS_TAKEN_YTD) <> 0) AND
(L.COMPANY = 'LHS') AND
((J.EFFSEQ= (SELECT MAX(INNERALIAS.EFFSEQ)
FROM PS_JOB INNERALIAS
WHERE INNERALIAS.EMPL_RCD_NBR = J.EMPL_RCD_NBR
AND INNERALIAS.EMPLID = J.EMPLID
AND INNERALIAS.EFFDT = J.EFFDT)
AND
J.EFFDT = (SELECT MAX(INNERALIAS.EFFDT)
FROM PS_JOB INNERALIAS
WHERE INNERALIAS.EMPL_RCD_NBR = J.EMPL_RCD_NBR
AND INNERALIAS.EMPLID = J.EMPLID
AND INNERALIAS.EFFDT <= SYSDATE))) AND
((LOC.EFFDT = (
SELECT MAX(INNERALIAS.EFFDT)
FROM PS_LOCATION_TBL INNERALIAS
WHERE INNERALIAS.LOCATION = LOC.LOCATION
AND INNERALIAS.EFFDT <= SYSDATE)))))
AND
(L.EMPL_RCD_NBR = J.EMPL_RCD_NBR ) AND (L.EMPLID = J.EMPLID ) AND (J.REPORTING_LOCATION = LOC.LOCATION ) AND (L.EMPLID = P.EMPLID )
ORDER BY
J.DEPTID, P.NAME

In fact I had tried with /*+RULE*/ hint and the query ran in 1 minute just like in Oracle 8 though the explain plan was almost same as without hintSounds like you are close to finding out what is happening differently and why it makes such a big difference. I think that was the point of Pete's suggestion, not to hope that the RULE hint would be a solution in itself. I sometimes try increasing the dynamic sampling level for the same reason.
btw please post code and execution plans in tags (see FAQ for details).
Also you can post the {noformat}<{noformat}> operator by placing {noformat} tags around the opening "<" symbol.
Edited by: William Robertson on Sep 9, 2009 10:41 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • When the page onload  the query must run.

    I put bind variables in a view objects. When the page onload the query must run. i added ExecuteWithParams , invokeaction in page definition. And i added in java bean follow codes. And then i added this code in Page definition like this
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="10.1.3.40.66" id="evrakPageDef"
    Package="view.pageDefs" ControllerClass="#{evrak}">
    evrak java code :
    String evr= "20070002362";
    String krm= "02030000";
    String prt= "B";
    String prs= "60711630";
    AdfFacesContext faces= AdfFacesContext.getCurrentInstance();
    faces.getProcessScope().put("evrak",evr);
    faces.getProcessScope().put("kurumcode",krm);
    faces.getProcessScope().put("pertur",prt);
    faces.getProcessScope().put("sicil",prs);
    When the *.jspx page onload , the query is not running. the items are empty.
    What can i do anymore?
    Thanks

    Hi,
    - create the binding fro the ExecuteWithParams
    - go to the binding and expand it
    - select the argument items and use EL to provide the values (if not they are static)
    - create a invokeAction in the executable section of the binding
    - point the invoke action to the execute with params method
    - run the page
    Frank

  • The query just run the first time, the second doesnt run

    The query just run the first time, the second doesnt run, i checked it in the SM50 and appear this msg:
    CL_RSR_CACHE_BO_FF============CP
    its not a problem of indexes, i repaired it but its really weird cause the first time the query run ok, the second doesnt, it seems that the cache is confused or i dont know, help guys, i'll really appreciate it

    I was watching the notes, its really weird when i load the cube and execute the query for the first time, its ok, to the second stay in cache, but i was watching that the cube doesnt allow me activat the BD statistics, i dont know if this is necesary to improve the performance of the query, what i know is this:
    1- before i create a Hierarchy for an infoobject thta is in the cube ,  the query used to run ok. Now when i load the first time and execute its ok, but the second stay in cache.
    2- now i can activate the statistics for the cube, the indexes are ok, i checked for the RSRV and all is ok less the statistics.
    what can i do help friends...

  • How identify the query which cause a SERVERERROR?

    Hi,
    Can I identify the query which called the trigger SERVERERROR?
    I need this because we have a error in our log, and we can not identify the cause.
    Thanks,
    Everson

    Michaeles,
    The problem is here:
    for i in 1 .. ora_sql_txt (v_sql_text)
    Take a look in my trigger code.
    CREATE OR REPLACE TRIGGER "LOG_ERRORS" AFTER SERVERERROR ON DATABASE
    declare
    v_osuser VARCHAR2(30);
    v_machine VARCHAR2(64);
    v_username VARCHAR2(30);
    v_program VARCHAR2(64);
    v_error VARCHAR2(1000);
    v_sql_text ora_name_list_t;
    v_sql CLOB;
    v_test varchar2(4000) := 'A';
    BEGIN
    select osuser, machine, program, username into v_osuser, v_machine, v_program, v_username
    from v$session
    where audsid = userenv('SESSIONID') and rownum =1;
    v_test := v_test||'B';
    begin
    for i in 1 .. ora_sql_txt (v_sql_text)
    loop
    v_test := v_test||'C';
    v_sql := v_sql || v_sql_text (i);
    end loop;
    v_test := v_test||'D';
    exception
    when others then
    v_test := v_test||'E';
    v_test := v_test||'F'||substr(sqlerrm,1,100);
    end;
    v_test := v_test||'G';
    v_error := DBMS_UTILITY.FORMAT_ERROR_STACK;
    insert into everson.log_erros_bd(data,osuser,machine,username,program,erro,sql)
    values(sysdate,v_osuser,v_machine,v_username,v_program,v_error||'-'||v_test,v_sql);
    exception
    when others then -- null;
    insert into everson.log_erros_bd(data,osuser,machine,username,program,erro,sql)
    values(sysdate,'ERRO '||v_osuser,v_machine,v_username,v_program,DBMS_UTILITY.FORMAT_ERROR_STACK,v_test);
    END;
    The v_test variable is only for debug, and after the error it contains:
    ORA-04043: object mensagem does not exist
    -ABEFORA-06502: PL/SQL: numeric or value error
    ORA-04043: object mensagem does not existG
    How you can see, the v_test jump to 'B' to 'E', jumping the debugs in loop, 'C' and 'D', and in exception I get the message 'ORA-06502: PL/SQL: numeric or value error'.
    Any idea?

  • How long should I let the extracting process run? It has been over 6 hours (Photoshop Elements.

    How long should I let the extracting process run? It has been over 6 hours (Photoshop Elements). I have already received Disk Image Error - 4960. System will not let me attempt another download as message that download is in queue is received??

    Cancel it, try this:
    Direct Download Links for Adobe Software
    Use Winzip to extract the 7z file.
    Mylenium

  • How to check the query, which had run how many times in a year?

    <Moderator Message: ok, subject is better now but you didn't search at all. Therefore thread is locked again>
    Hi All,
    I want to check the Query statistics like it had run how many times in a year?
    Regards,
    Kiran
    Edited by: Siegfried Szameitat on Dec 9, 2008 11:55 AM

    Hi Kiran,
    please follow the below steps
    1. Create a query for that purpose
    2. Make use of BW Statistic InfoProvider 0BWTC_C02
    3. in Col: Key Figure:0TCTNAVCTR
    4. in Row: 0TCTQUERY (select a variable 0TCTQUYS)
    5. in Filter: BW System( 0TCTSYSID) [give yr source system name whether its production/quality)
    6. in Free char you can give calmonth/year  or user if want to do so.
    save and execute the query
    you will be asked for input the query name
    As output you will be getting count (as many times query is hit by all users since the time it was created)
    if you give date and user name then it will display the count accordingly.
    Hope it Clarifies you.
    Thanks & Regards
    Nagaraju.V

  • Can we find the size of the query which is retrived in select operation??

    Hi,
    We run one select query and found that the query is retriving 953368 records(rows). Now is there any way to calculate how big is that query in terms of size.??
    Could you pls suggest me.
    Thanks,
    Srini....

    >
    We run one select query and found that the query is retriving 953368 records(rows)
    >
    Yes but how many different tables are involved? How many columns? What are the datatypes of the columns?
    If I run a query that returns one row it could have 900 columns defined as CHAR(4000), or one column defined as CHAR(1).
    So row length is somewhere between 1 byte and 3.6MB times 1 million rows.
    I'm guessing 1 million bytes minimum and 3.6GB on the high side.

  • Optimizing the query - which takes more time

    Hi,
    Am having a query which was returning the results pretty fast one week back but now the same query takes more time to respond, nothing much changed in the table data, what could be the problem. Am using IN in the where clause, whether that could be an issue? if so what is the best method of rewriting the query.
    SELECT  RI.RESOURCE_NAME,TR.MSISDN,MAX(TR.ADDRESS1_GOOGLE) KEEP(DENSE_RANK LAST ORDER BY TR.MSG_DATE_INFO) ADDRESS1_GOOGLE,
                    MAX(TR.TIME_STAMP) MSG_DATE_INFO FROM  TRACKING_REPORT TR, RESOURCE_INFO RI
                    WHERE TR.MSISDN IN ( SELECT  MSISDN FROM  RESOURCE_INFO WHERE GROUP_ID ='4'
                   AND COM_ID='12') AND RI.MSISDN = TR.MSISDN
                   GROUP BY  RI.RESOURCE_NAME,TR.MSISDN ORDER BY MSG_DATE_INFO DESC

    Hi
    i have followed this link http://www.lorentzcenter.nl/awcourse/oracle/server.920/a96533/sqltrace.htm in enabling the trace and found out the following trace output, can you explain the problem here and its remedial action pls.
    SELECT  RI.RESOURCE_NAME,TR.MSISDN,MAX(TR.ADDRESS1_GOOGLE) KEEP(DENSE_RANK
      LAST ORDER BY TR.MSG_DATE_INFO) ADDRESS1_GOOGLE,                      MAX(TR.TIME_STAMP)
      MSG_DATE_INFO
    FROM
      TRACKING_REPORT TR, RESOURCE_INFO RI                          WHERE RI.GROUP_ID ='426'                         AND
      RI.COM_ID='122' AND RI.MSISDN = TR.MSISDN                      GROUP BY  RI.RESOURCE_NAME,
      TR.MSISDN
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.02          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        6     13.69     389.03      81747     280722          0          72
    total        8     13.70     389.05      81747     280722          0          72
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 281 
    Rows     Row Source Operation
         72  SORT GROUP BY
    276558   NESTED LOOPS 
         79    TABLE ACCESS FULL RESOURCE_INFO
    276558    TABLE ACCESS BY INDEX ROWID TRACKING_REPORT
    276558     INDEX RANGE SCAN TR_INDX_ON_MSISDN_TIME (object id 60507)
    ********************************************************************************and the plan_table output is
    STATEMENT_ID     TIMESTAMP     REMARKS     OPERATION     OPTIONS     OBJECT_NODE     OBJECT_OWNER     OBJECT_NAME     OBJECT_INSTANCE     OBJECT_TYPE     OPTIMIZER     SEARCH_COLUMNS     ID     PARENT_ID     POSITION     COST     CARDINALITY     BYTES     OTHER_TAG     PARTITION_START     PARTITION_STOP     PARTITION_ID     OTHER     DISTRIBUTION     CPU_COST     IO_COST     TEMP_SPACE     ACCESS_PREDICATES     FILTER_PREDICATES
         23-Mar-11 23:36:45          SELECT STATEMENT                                   CHOOSE          0          115     115     1058     111090                                        115               
         23-Mar-11 23:36:45          SORT     GROUP BY                                        1     0     1     115     1058     111090                                        115               
         23-Mar-11 23:36:45          NESTED LOOPS                                             2     1     1     9     4603     483315                                        9               
         23-Mar-11 23:36:45          TABLE ACCESS     FULL          BSNL_RTMS     RESOURCE_INFO     2          ANALYZED          3     2     1     8     1     30                                        8               "RI"."GROUP_ID"=426 AND "RI"."COM_ID"='122'
         23-Mar-11 23:36:45          TABLE ACCESS     BY INDEX ROWID          BSNL_RTMS     TRACKING_REPORT     1          ANALYZED          4     2     2     1     3293     246975                                        1               
         23-Mar-11 23:36:45          INDEX     RANGE SCAN          BSNL_RTMS     TR_INDX_ON_MSISDN_TIME          NON-UNIQUE          1     5     4     1     1     3293                                             1          "RI"."MSISDN"="TR"."MSISDN"     

  • Undo_tablespace and undo_retetion or tune the query  which one to increase

    hi all,
    In my logs file s
    ORA-01555 caused by SQL statement below (SQL ID: 9nc0n06yryhbk, Query Duration=165122 sec, SCN: 0x05ff.062f3363):
    Tue Feb 5 02:26:39 2008
    SELECT /*+ FIRST_ROWS */ /*+ ORDERED */ B.GID ,K.ELEMENT_TYPE ,K.DATA_SOURCE_GID ,K.PROD_ID ,K.OPTION_CD ,K.MCC ,K.SPN ,K.REGION_CD ,K.WW_CD ,K.COUNTRY_CD ,K.ERROR ,B.GBATCH_ID
    ,B.PERIOD_SEQ_NUM ,B.ACTION ,B.ERROR B_ERROR ,B.COST ,B.INPUT_FILE_ROW_NUM ,B.ACTION_STATUS ,B.ACTION_TIMESTAMP FROM T_INPUT_BUCKET B, T_COS_INPUT_KEY K WHERE B.ACTION_STATUS =
    'initial' AND B.GINPUT_KEY_ID = K.GID AND B.GBATCH_ID = :B1 AND ROWNUM < 8001
    Tue Feb 5 02:35:21 2008
    Thread 2 advanced to log sequence 42907
    Mon Feb 4 09:10:55 2008
    ORA-01555 caused by SQL statement below (SQL ID: 9nc0n06yryhbk, Query Duration=104081 sec, SCN: 0x05ff.05ebc008):
    Mon Feb 4 09:10:55 2008
    SELECT /*+ FIRST_ROWS */ /*+ ORDERED */ B.GID ,K.ELEMENT_TYPE ,K.DATA_SOURCE_GID ,K.PROD_ID ,K.OPTION_CD ,K.MCC ,K.SPN ,K.REGION_CD ,K.WW_CD ,K.COUNTRY_CD ,K.ERROR ,B.GBATCH_ID
    ,B.PERIOD_SEQ_NUM ,B.ACTION ,B.ERROR B_ERROR ,B.COST ,B.INPUT_FILE_ROW_NUM ,B.ACTION_STATUS ,B.ACTION_TIMESTAMP FROM T_INPUT_BUCKET B, T_COS_INPUT_KEY K WHERE B.ACTION_STATUS =
    'initial' AND B.GINPUT_KEY_ID = K.GID AND B.GBATCH_ID = :B1 AND ROWNUM < 8001
    Mon Feb 4 09:14:08 2008
    ===============================================
    and my undo_retention
    Current usage:
    UNDO_01 96736 11596 12 88
    UNDO_02 96736 9357 10 90
    NAME TYPE VALUE
    undo_management string AUTO
    undo_retention integer 36000
    can anyone please guide me which one is best to increase undo_retention or undo_tablespace
    or tune the query?
    my database version is
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
    PL/SQL Release 10.2.0.2.0 - Production
    "CORE     10.2.0.2.0     Production"
    TNS for HPUX: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    thanks in advance

    IMO best is to
    1) tune the query to minimize time and resource use;
    2) set the undo_retention to size the undo tablespace for the required 'consistent read' rebuild requirements;
    3) set the retention guarantee appropriately
    4) size the undo tablespace based on the required size, probably dictated by 2)
    Why is this an 'either one or other' question? When driving a car and looking for best fuel efficiency, you tune up the car, drive properly AND use the right fuel. You don't just pick one and leave it at that.

  • Inserting 320 millions rows...the speed change whilst the query is running

    Hi guys, I got a strange behavior in my data warehouse. When I insert data in a table I start to take note of the speed. So in one minute, at the beginning the speed was 3 millions every minute (it expected 312 millions rows) but now, after five hours the
    speed is 83.000 row per minute and the table has already 234 millions rows. Now, I'm wondering if this behavior is right and how I can improve the performance (if I can whilst the insert is running).
    Many Thanks

    change Database recovery mode to bulklogged(Preferably)/ simple.
    No - that will not solve the problem because INSERT INTO isn't bulk logged (automatically). To force bulk logged operation the target table need to be locked exclusively!
    Greg Robidoux has a great matrix for that!
    http://www.mssqltips.com/sqlservertip/1185/minimally-logging-bulk-load-inserts-into-sql-server/
    @DIEGOCTIN,
    I assume nobody can really give you an answer because it could have so much reasons for it! As Josh has written GROWTH could have been a problem if Instant File Initialization isn't setup. But 320 mil records in one transaction could cause a heavy growth
    of the log file, too. This cannot participate from Instant File Initialization.
    Another good tip came from Olaf, too!
    I would suggest to insert the data with a tablock. In this case the transaction is minimally logged and the operation will not copy rows but pages into the target table. I've written a WIKI about that topic here:
    http://social.technet.microsoft.com/wiki/contents/articles/20651.sql-server-delete-a-huge-amount-of-data-from-a-table.aspx
    Wish you all a merry christmas and a happy new year!
    MCM - SQL Server 2008
    MCSE - SQL Server 2012
    db Berater GmbH
    SQL Server Blog (german only)

  • Compilingh a procdure which runs every 15 minutes haning

    Hi,
    We have a schedule set up to run a pl/sql packaged procedure every 15 minutes.
    Oracle 11.2.0.3 on AIX Power Series 7
    Runs fine but when need make change to pacakge, finding that have to stop the scheduled job, change and recompile procedure then recreate the schedule.
    Is this expected behaviour or are we doing something wrong?
    Could try dbms_scheduler.disable job?
    Thanks
    Edited by: user5716448 on 05-Nov-2012 10:40

    Found out was because running when trying to compile.

  • Fine tunning the query which uses /*+ USE_CONCAT */ table hint

    Some of the queries in our application uses the /*+ USE_CONCAT */ table hint which takes huge time for the execution in Oracle database.when we fire the below query in 250Million production database it takes approx.3min for the execution.
    Because of this we are facing a performance issue in the application.
    Below is the sample query :
    SELECT /*+ USE_CONCAT */ * FROM DI_MATCH_KEY WHERE NORM_COUNTRY_CD = 'US'
    AND ((( NORM_CONAME_KEY1 ='WILM I' OR NORM_CONAME_KEY2 = 'WILM I' OR NORM_CONAME_KEY23 = 'WILM I'
    OR NORM_CONAME_KEYFIRST ='WILLIAM' ) AND NORM_STATE_PROVINCE = 'CA' ) OR NORM_ADDR_KEY2 = 'CALMN 12 3 OSAI')
    Regarding the indexes almost for all the columns combination for the above sql index already created in table.
    Your suggestions will be appreciated
    Thanks,
    Regards,
    Krishna kumar

    Hi,
    Thanks for our valuable inputs.
    As suggested find attached explain plan and trace file details in the excel sheet.
    TRACE FILE:
    <pre>
    TKPROF: Release 10.2.0.1.0 - Production on Thu Feb 14 11:11:59 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Trace file: implhr01_ora_26457.trc
    Sort options: prsela exeela fchela
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    SELECT /*+ USE_CONCAT */ COUNT(*) FROM DI_MATCH_KEY WHERE NORM_COUNTRY_CD = 'US'
    AND ((( NORM_CONAME_KEY1 ='WILM I' OR NORM_CONAME_KEY2 = 'WILM I' OR NORM_CONAME_KEY23 = 'WILM I'
    OR NORM_CONAME_KEYFIRST ='WILLIAM' ) AND NORM_STATE_PROVINCE = 'CA' ) OR NORM_ADDR_KEY2 = 'CALMN 12 3 OSAI')
    call count cpu elapsed disk query current rows
    Parse 1 0.03 0.05 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 2 3.97 65.43 30633 64053 0 1
    total 4 4.00 65.49 30633 64053 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 76
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=64053 pr=30633 pw=0 time=65436584 us)
    73914 CONCATENATION (cr=64053 pr=30633 pw=0 time=61623673 us)
    0 TABLE ACCESS BY INDEX ROWID DI_MATCH_KEY (cr=4 pr=2 pw=0 time=32617 us)
    0 INDEX RANGE SCAN MKADDR_KEY2 (cr=4 pr=2 pw=0 time=32599 us)(object id 122583)
    75 TABLE ACCESS BY INDEX ROWID DI_MATCH_KEY (cr=80 pr=20 pw=0 time=1369427 us)
    75 INDEX RANGE SCAN MK_CY_KEY1_ST_PROV (cr=5 pr=0 pw=0 time=2119 us)(object id 122666)
    2 TABLE ACCESS BY INDEX ROWID DI_MATCH_KEY (cr=81 pr=2 pw=0 time=26723 us)
    77 INDEX RANGE SCAN MK_CY_KEY2_ST_PROV (cr=4 pr=0 pw=0 time=3641 us)(object id 122667)
    2 TABLE ACCESS BY INDEX ROWID DI_MATCH_KEY (cr=6 pr=0 pw=0 time=47 us)
    2 INDEX RANGE SCAN MK_CY_KEY1_AGN (cr=4 pr=0 pw=0 time=28 us)(object id 122670)
    73835 TABLE ACCESS BY INDEX ROWID DI_MATCH_KEY (cr=63882 pr=30609 pw=0 time=61503773 us)
    73905 INDEX RANGE SCAN MK_CY_KEY2_AGN (cr=266 pr=176 pw=0 time=148198 us)(object id 122745)
    alter session set sql_trace true
    call count cpu elapsed disk query current rows
    Parse 0 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 1 0.00 0.00 0 0 0 0
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 76
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 1 0.03 0.05 0 0 0 0
    Execute 2 0.00 0.00 0 0 0 0
    Fetch 2 3.97 65.43 30633 64053 0 1
    total 5 4.00 65.50 30633 64053 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 9 0.05 0.03 0 0 0 0
    Execute 23 0.05 0.08 0 0 0 0
    Fetch 98 0.01 0.01 0 137 0 76
    total 130 0.11 0.13 0 137 0 76
    Misses in library cache during parse: 9
    Misses in library cache during execute: 9
    2 user SQL statements in session.
    23 internal SQL statements in session.
    25 SQL statements in session.
    Trace file: implhr01_ora_26457.trc
    Trace file compatibility: 10.01.00
    Sort options: prsela exeela fchela
    1 session in tracefile.
    2 user SQL statements in trace file.
    23 internal SQL statements in trace file.
    25 SQL statements in trace file.
    11 unique SQL statements in trace file.
    561 lines in trace file.
    91 elapsed seconds in trace file.
    </pre>
    EXPLAIN PLAN:
    <pre>
    ID     OPERATION     OBJECT_NAME     CARDINALITY     BYTES     COST     CPU_COST
    0     SELECT STATEMENT          1     53     1886     15753172
    1     SORT          1     53          
    2     CONCATENATION                         
    3     TABLE ACCESS     DI_MATCH_KEY     8     424     10     78334
    4     INDEX     MKADDR_KEY2     8          4     30086
    5     TABLE ACCESS     DI_MATCH_KEY     3     159     7     53574
    6     INDEX     MK_CY_KEY1_ST_PROV     3          4     29286
    7     TABLE ACCESS     DI_MATCH_KEY     3     159     7     53740
    8     INDEX     MK_CY_KEY2_ST_PROV     3          4     29286
    9     TABLE ACCESS     DI_MATCH_KEY     5     265     7     55941
    10     INDEX     MK_CY_KEY1_AGN     5          4     29686
    11     TABLE ACCESS     DI_MATCH_KEY     2192     116176     1855     15511582
    12     INDEX     MK_CY_KEY2_AGN     2228          12     524136
    </pre>
    Kindly help us regarding this.
    Thanks,
    Krishna Kumar.

  • Problem facing in performance of the query which calls one function

    Hello Team,
    Actually am facing performance issue for the following query.Even though for columns in where condition indexes are there.Also I used the hints but no use.Pls suggest me how can I increase the performance.Currently it's taking around 5 mins to execute the select statement.
    SELECT crf_id, crf_code,crf_nme,
    DECODE(UPPER( fn_hrc_refs( crf_id)),'Y','Yes','No') ua_ind,
    creation_date, datetime_stamp, user_id
    FROM BC_FBCTOR
    ORDER BY crf_nme DESC;
    FUNCTION fn_hrc_refs (pi_crf_id IN NUMBER)
    RETURN VARCHAR2
    IS
    childref VARCHAR2 (1) := 'N';
    cnt NUMBER := 0;
    BEGIN
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM BC_CALIB
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM BC_CALIB_DET
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM BC_MPG_DTL
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM BC_CNTRY_DTL
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM BC_COR
         WHERE x_axis_crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM BC_RESI_COR
         WHERE y_axis_crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM BC_PRIME
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM DR_FBCT
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM DR_RISK
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM EC_DTL
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM EC_RESULT
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM EC_LOSS
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM EC_CRITERIA
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM EC_CORR
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
         SELECT NVL (COUNT (*), 0)
         INTO cnt
         FROM EC_PORT
         WHERE crf_id = pi_crf_id;
         IF cnt<> 0
         THEN
         childref := 'Y';
         RETURN childref;
         END IF;
    RETURN childref;
    EXCEPTION
    WHEN OTHERS
    THEN
    childref := 'N';
    RETURN childref;
    END;
    Regards,
    Ashis

    You are checking for the existence of detail records. What is the purpose of this. Most applications I know rely on normal foreign key constraint to ensure parent-child relationsships.
    The select is slow for two reasons.
    reason one) You count all details records when you only need to know if one detail records exists or not.
    reason two) Multiple context switches between sql and pl/sql for each row of your parent table
    SELECT NVL (COUNT (*), 0)
    INTO cnt
    FROM BC_CALIB
    WHERE crf_id = pi_crf_id;
    IF cnt 0
    THEN
    childref := 'Y';
    RETURN childref;
    END IF;This could be replaced by
    begin
       SELECT 'Y'
       INTO childref
       FROM BC_CALIB
       WHERE crf_id = pi_crf_id
       and rownum = 1; /* only fetch one row */
    execption
       when no_data_found then
         /* continue with the next select */
    end;
    return childref;but this would still do a lot of context switches, especially for parents without a detail records.
    Also consider this option:
    SELECT crf_id, crf_code,crf_nme,
          case when exists (SELECT null FROM BC_CALIB t WHERE t.crf_id = BC_FBCTOR.crf_id)
                 then 'Yes'
                 when exists (SELECT null FROM BC_CALIB_DET t WHERE t.crf_id = BC_FBCTOR.crf_id)
                 then 'Yes'
          else
              'No'
          end ua_ind,
    creation_date, datetime_stamp, user_id
    FROM BC_FBCTOR
    ORDER BY crf_nme DESC;It should also be possible to use a UNION ALL select instead of different single case lines. But i choose this way since it resembles your original selection a bit better. And you could change the 'Yes' to something different like 'Childs in Table abc'.
    Edited by: Sven W. on Sep 5, 2008 2:29 PM

  • Cancel the query which uses full transaction log file

    Hi,
    We have reindexing job to run every week sunday. During the last run, the transaction log got full and the subsequent transactions to the database got errorred out stating 'Transaction log is full'. I want to restrict the utilization of the log file, that
    is, when the reindexing job reaches the utilization of the log file to a certain threshold automatically the job should get cancelled. Is there any way to get it.

    Hi,
    We have reindexing job to run every week sunday. During the last run, the transaction log got full and the subsequent transactions to the database got errorred out stating 'Transaction log is full'. I want to restrict the utilization of the log file, that
    is, when the reindexing job reaches the utilization of the log file to a certain threshold automatically the job should get cancelled. Is there any way to get it.
    Hello,
    Instead of Putting limit on trn log it would be good to find out cause causing high utilization.Even if you find that your log is growing because of some transaction it would be a blunder to rollback its little easy to do it for Index rebuild but if you
    cancel for some delete operation you would end up in mess.Please don't create a program to delete or kill running operation.
    You can create custom job for alert for trn log file growth.That would be good.
    From 2008 onwards Index rebuild is fully logged so sometimes it causes trn log issue.To solve this either you run index rebuild for specific tables or for selective tables.
    Other option is widely accepted Ola Hallengren script for index rebuild.I suggest you try this
    http://ola.hallengren.com/
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How to read  input data of the process which running fine

    Hi Guys,
    How to read the recently completed BPEL PROCESSes input data ( input xml) .
    Please help me.
    Regards
    janardhan

    Some browsers behave differently, FireFox 2 generally works better than FireFox 3 and IE.
    If you select the process that has run from the BPEL console in the instances tab you can select Audit or Flow. Audit generally works best at seeing the XML being past to each activity but the flow is nice to follow graphically. The major issue with the flow is that some payloads are displayed as a URL link. In IE this sometimes doesn't work. If this is the case go to the same point in the Audit and the XML will be there. This is also a good place to copy and paste xml for documentation purposes.
    cheers
    James

Maybe you are looking for

  • Logic pro optimization

    Hello my name is Amirel and this is my 1st time on the forum could any one advice me in regards to optimizing my logic pro on a macbook pro? I interface audio via motu traveler. Thanks

  • About the microsoft loopback adapter settings

    In the minisap setup process, when I use the recommended loopback setting and change the ip to 10.10.0.10 and also change the host file. But If I do this , it's really slow for my minisap to run~~~ So I just change the ip to local host (127.0.0.1)aga

  • Trading partner is not populated on G/L accounts

    Dear All, We have activated trading partners. When the SD document is posted only customer account documents are getting populated with "trading partner". However - "trading partner" is not copied to G/L account.(revenue accounts, cost of goods sold)

  • When is a display too big? (30inch)

    Not scientific for sure, but I am looking for some opinions I am looking to get a 30inch along with a new Mac Pro (currently running the 23inch - and I feel longing for more real estate quite often). I am wondering if, as you sit fairly close, people

  • How do I fully sync all music under iOS7?

    I downloaded iOS7 when it came out, since then I have lost access to my full music library, I have: 1. factory reset the iPhone and attempted to re-sync 2. saved to the Cloud and attempted re-sync 3. set the bit rate to 128, undid that 4, selected on