Latch free waits with the parallel execution

Hello

I have a table in a DB 11.1.0.7 with millions of lines I need of aggregation after a search on each line operation. The operation consisted in the determination of a small, constant lookup table the highest value that is less than a column. So I have this array of so-called transation, with some traits of hundreds:
CREATE TABLE ref_trad (
  entry     varchar2(50) PRIMARY KEY,
  id        integer      NOT NULL );
and a small function that gets the value of your choice (after an additional mapping):
CREATE OR REPLACE FUNCTION translate_num(num IN varchar2)
  RETURN integer RESULT_CACHE RELIES_ON (ref_block)
AS
  nm_id integer;
BEGIN
  SELECT m.number_id
    INTO nm_id
    FROM ref_number_map m INNER JOIN ref_trad t ON (m.block_id = t.id)
   WHERE t.entry = (SELECT max(entry) FROM ref_trad WHERE entry <= num);

  RETURN nm_id;
  
  EXCEPTION
    WHEN NO_DATA_FOUND THEN
      RETURN 0;
END;
Now when I try to aggregate the table using parallelism, I get a lot of waits 'latch free '. With 4 parallel sessions for example, looking at the graphs in 'EM, I get about 2.5 sessions on CPU and 1.5 on waiting 'latch free '. I have the impression of reading around that the wait could be due to a hot block in index table of ref_trad or something similar. I tried several things, such as the use of the tables of index_organized or the partitioning of the tiny table_reference, hoping to get more parallelism, without spectacular results. So my questions to those who know it are the following:

-How to determine with precision the cause for waiting latch_free events? (e.g., the hot block, the piece of PL/SQL code, etc.)
Is there some sort of mode of implementation of a standard and efficient lookup table? (I've heard on the loading table in a PL/SQL table, would it be useful? No matter what pointer on how to do this? )
-Why should there be contention in the first place in this case, because all the search logic is read-only?

Thanks for all your help!
Chris

Hi Chris,

-How to determine with precision the cause for waiting latch_free events? (e.g., the hot block, the piece of PL/SQL code, etc.)

Trace your SQL, search slaves PX trace files, look for the settings for event wait - and you here. Another option is to use one of the scripts of Tanel Poder - waitprof.

Is there some sort of mode of implementation of a standard and efficient lookup table? (I've heard on the loading table in a PL/SQL table, would it be useful? No matter what pointer on how to do this? )

Not sure about a 'standard', but it's a good thing at least do a table index.

-Why should there be contention in the first place in this case, because all the search logic is read-only?

Since Oracle should have the means of access of sinchronizing to a shared structures - LMS - since they are used simultaneously by several processes.

A good thing to make your faster SQL is to get rid of PL/SQL - it's not a good thing to use SQL [even with RESULT_CACHE | http://www.pythian.com/news/598/oracle-11g-query-result-cache-rc-latches]. Write your logic in a single pure SQL, it might be very beneficial even without special setting.

Tags: Database

Similar Questions

  • There is a configuration option that allows the parallel execution of sub vi?

    I'm trying to run a vi in teststand has two parallel execution paths. A path under vi implements the trigger and wait for data from a module scope, while in the other lane, I'm starting a power supply. The power waits until the scope is armed and runs.

    It works as a standalone vi. When I try to run this vi in teststand he works the first vi scope and then runs the power supply. Of course vi opportunities get to expiration and outputs and data are not met.

    I tried a number of methods of synchronization, and although they seem to work standalone, as soon as I try them in Testsatnd I have this problem.

    I am new to teststand and I was wondering if there is some configuration config I missed which allows a vi like this to run as he's independent.

    I have a number of simple screws that run as planned, but this one left me speechless.

    I had to split these screws but would really prefer to have them in the same vi.

    (The latest versions of teststand and Labview running)

    Henry

    hkroker,

    It is a known problem. Please refer to the following KB to help solve your problem.

    - Parallel blocks run sequentially why does my LabVIEW VI when it is called from TestStand?

    Concerning

    Anand jegou

    National Instruments

  • Wait for the mechanism in the parallel execution of packages

    Dear all,

    I submit two packets in parallel as below, which works very well.

    I present this in a shell script which is registered as a front end program.

    Front end program completed in a second, while the data are not visible in the tables, the data is visible only when the execution of the package completed.

    Please can you suggest a mechanism so that I can make the plsql block in shell script to wait for both the delivery of completed packages.

    #!/bin/sh                                                                                 |
    . $CUST_TOP/bin/CUST_ID_CM.env
    export INFA_USER=$INFA_USER
    export userpass=`(echo $1 | cut -f2 -d'"' | cut -d '"' -f3)`
    ploadtype=$5 
    pyear=$7
    #####################################################################
    if [ "$ploadtype" = "Restatement" ]; then
    sqlplus -s $userpass <<EOF
    set heading off feedback off verify off serveroutput on
    spool /usr/tmp/tmp_tph_load.txt
    DECLARE
      l_cnt NUMBER;
    BEGIN
      DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_RESTATEMENTS',
                                job_type            => 'STORED_PROCEDURE',
                                job_action          => 'RESTATEMENTS_DATAFEED_PKG.INSERT_RESTATEMENTS_P',
                                number_of_arguments => 1,
                                enabled             => FALSE,
                                auto_drop           => TRUE);
      DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name          => 'YEARLY_RESTATEMENTS',
                                            argument_position => 1,
                                            argument_value    => '$7');
      DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS');
      DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_ACTUALS',
                                job_type            => 'STORED_PROCEDURE',
                                job_action          => 'ACTUALS_DATAFEED_PKG.INSERT_ACTUALS_P',
                                number_of_arguments => 1,
                                enabled             => FALSE,
                                auto_drop           => TRUE);
      DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name          => 'YEARLY_ACTUALS',
                                            argument_position => 1,
                                            argument_value    => '$7');
      DBMS_SCHEDULER.ENABLE('YEARLY_ACTUALS');
      LOOP
        SELECT COUNT(1)
          INTO l_cnt
          FROM DBA_SCHEDULER_RUNNING_JOBS
         WHERE UPPER(job_name) IN
               (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
        EXIT WHEN l_cnt < 1;
      END LOOP;
    END;
    /
    EOF
    #
    fi
    exit
    

    Your problem is the timing. You can perform the check at DBA_SCHEDULER_RUNNING_JOBS before the entry is actually in there.

    Here is an example. I just submitted a PLSQL_BLOCK waiting for 60 seconds.

    SQL> DECLARE
      2    l_cnt NUMBER;
      3  BEGIN
      4    dbms_output.put_line(systimestamp || ' - Started');
      5    DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_RESTATEMENTS',
      6                              job_type            => 'PLSQL_BLOCK',
      7                              job_action          => 'BEGIN DBMS_LOCK.SLEEP(60); END;',
      8                              enabled             => FALSE,
      9                              auto_drop           => TRUE);
     10    DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS');
     11
     12    LOOP
     13      SELECT COUNT(1) into l_cnt
     14        FROM DBA_SCHEDULER_RUNNING_JOBS
     15       WHERE UPPER(job_name) IN
     16             (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
     17
     18      EXIT WHEN l_cnt < 1;
     19      dbms_output.put_line(systimestamp || ' - Waiting');
     20      dbms_lock.sleep(10);
     21    END LOOP;
     22    dbms_output.put_line(systimestamp || ' - Completed');
     23  END;
     24  /
    04-DEC-14 02.32.00.075794000 AM -05:00 - Started
    04-DEC-14 02.32.00.121862000 AM -05:00 - Completed
    
    PL/SQL procedure successfully completed.
    

    Now it ends immediately. But you can see that the job is still running.

    SQL>     SELECT COUNT(1)
      2        FROM DBA_SCHEDULER_RUNNING_JOBS
      3       WHERE UPPER(job_name) IN
      4             (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
    
      COUNT(1)
    ----------
             1
    

    Now I make my code to wait 5 seconds before the audit

    SQL> DECLARE
      2    l_cnt NUMBER;
      3  BEGIN
      4    dbms_output.put_line(systimestamp || ' - Started');
      5    DBMS_SCHEDULER.CREATE_JOB(job_name            => 'YEARLY_RESTATEMENTS',
      6                              job_type            => 'PLSQL_BLOCK',
      7                              job_action          => 'BEGIN DBMS_LOCK.SLEEP(60); END;',
      8                              enabled             => FALSE,
      9                              auto_drop           => TRUE);
     10    DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS');
     11
     12    -- Wait for a wile before checking
     13    dbms_lock.sleep(5);
     14    LOOP
     15      SELECT COUNT(1) into l_cnt
     16        FROM DBA_SCHEDULER_RUNNING_JOBS
     17       WHERE UPPER(job_name) IN
     18             (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements'));
     19
     20      EXIT WHEN l_cnt < 1;
     21      dbms_output.put_line(systimestamp || ' - Waiting');
     22      dbms_lock.sleep(10);
     23    END LOOP;
     24    dbms_output.put_line(systimestamp || ' - Completed');
     25  END;
     26  /
    04-DEC-14 02.33.09.294256000 AM -05:00 - Started
    04-DEC-14 02.33.14.347866000 AM -05:00 - Waiting
    04-DEC-14 02.33.24.369777000 AM -05:00 - Waiting
    04-DEC-14 02.33.34.389725000 AM -05:00 - Waiting
    04-DEC-14 02.33.44.410508000 AM -05:00 - Waiting
    04-DEC-14 02.33.54.430561000 AM -05:00 - Waiting
    04-DEC-14 02.34.04.450684000 AM -05:00 - Waiting
    04-DEC-14 02.34.14.462191000 AM -05:00 - Completed
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Now you can see the code entered in the loop and waited.

  • Feature of the parallel execution of SQL query

    Hello guys,.

    I installed a 11 GR 2 Oracle RAC (11.2.0.3) database, but I see the use of the feature of running parallel SQL queries, but I never used that.

    I would like to know if this feature is enabled by default on CCR environments and if it does not require me to pay for Enterprise Edition.

    NAME DETECTED_USAGES FIRST_USA LAST_USAG CURRE

    ---------------------------------------------------------------- --------------- ----- --------- ---------

    Checking Options 1 TRUE 9 October 15 October 9, 15

    BMG Auto setting 1 TRUE 9 October 15 October 9, 15

    Memory of the execution of SQL auto 1 TRUE 9 October 15 October 9, 15

    Automatic management of the space Segment (System) 1 TRUE 9 October 15 October 9, 15

    Automatic Storage Management 1 TRUE 9 October 15 October 9, 15

    Management of the Undo Automatic 1 TRUE 9 October 15 October 9, 15

    Character set 1 TRUE 9 October 15 October 9, 15

    Deferred Segment creation 1 TRUE 9 October 15 October 9, 15

    Locally managed tablespaces (System) 1 TRUE 9 October 15 October 9, 15

    Locally managed tablespaces (user) 1 TRUE 9 October 15 October 9, 15

    Logfile multiplexing 1 TRUE 9 October 15 October 9, 15

    Oracle Java Virtual Machine (System) 1 TRUE 9 October 15 October 9, 15

    Oracle utility of metadata API 1 TRUE 9 October 15 October 9, 15

    1 SQL query in parallel TRUE 9 October 15 October 9, 15

    Partitioning (System) 1 TRUE 9 October 15 October 9, 15

    Real Application Clusters (RAC) 1 TRUE 9 October 15 October 9, 15

    Recovery zone 1 TRUE 9 October 15 October 9, 15

    SECUREFICHIERS (System) 1 TRUE 9 October 15 October 9, 15

    SECUREFICHIERS (user) 1 TRUE 9 October 15 October 9, 15

    The parameter server file 1 TRUE 9 October 15 October 9, 15

    Thanks in advance,

    Franky

    You are not, but Oracle is, since you are using RAC.  Oracle relies on execution in parallel against the gv$ views so even if you can't use it in SE way common Oracle can when it comes to query against one of the points of view gv$.  That's why DBA_FEATURE_USAGE_STATISTICS reports that you see.

    David Fitzjarrell

  • How to avoid the parallel execution

    Hello!

    In my database is this undesirable parallelization of the query.
    All of the tables involved a degree = 1,
    If I just figured there is no method to avoid this problem except reduction of the degree of index?
    I'm usung 11.2.0.3

    Thank you and best regards,
    Pavel

    Well, you can use the NOPARALLEL hint if you do not want parallelism to be there.

    Aman...

  • 12 c parallel execution Plans

    Hello world

    I have a little a problem of performance on 12 c that gives me a little trouble at the head. I moved from 11 to 12 databases and no amendment of the application have been made. Our requests are generated somewhat dynamically, so that they are the same thing every time.

    Let's start with the execution plan I get:

    SQL > select * from table (dbms_xplan.display ());


    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 3567104424

    -----------------------------------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation                                            | Name                  | Lines | Bytes | Cost (% CPU). Time |    TQ | IN-OUT | PQ Distrib.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                       |    55.  7095 |  3764 (1) | 00:00:01 |        |      |            |

    |   1.  COORDINATOR OF PX |                       |       |       |            |          |        |      |            |

    |   2.   PX SEND QC (ORDER). : TQ10006 |    55.  7095 |  3764 (1) | 00:00:01 |  Q1, 06 | P > S | QC (ORDER).

    |   3.    SORT ORDER BY |                       |    55.  7095 |  3764 (1) | 00:00:01 |  Q1, 06 | SVCP |            |

    |   4.     PX RECEIVE                                       |                       |    55.  7095 |  3763 (1) | 00:00:01 |  Q1, 06 | SVCP |            |

    |   5.      RANGE OF SEND PX | : TQ10005 |    55.  7095 |  3763 (1) | 00:00:01 |  Q1, 05 | P > P | RANGE |

    |   6.       UNIQUE FATE |                       |    55.  7095 |  3763 (1) | 00:00:01 |  Q1, 05 | SVCP |            |

    |*  7 |        HASH JOIN                                     |                       |    55.  7095 |  3762 (1) | 00:00:01 |  Q1, 05 | SVCP |            |

    |   8.         PX RECEIVE                                   |                       |   801 | 50463 |  3696 (1) | 00:00:01 |  Q1, 05 | SVCP |            |

    |   9.          PX SEND HASH | : TQ10003 |   801 | 50463 |  3696 (1) | 00:00:01 |  Q1, 03 | P > P | HASH |

    | * 10 |           HASH JOIN                                  |                       |   801 | 50463 |  3696 (1) | 00:00:01 |  Q1, 03 | SVCP |            |

    |  11.            RECEIVE PX |                       |   801 | 40851 |  2333 (1) | 00:00:01 |  Q1, 03 | SVCP |            |

    |  12.             PX SEND BROADCAST | : TQ10002 |   801 | 40851 |  2333 (1) | 00:00:01 |  Q1, 02 | P > P | BROADCAST |

    |  13.              NESTED LOOPS |                       |   801 | 40851 |  2333 (1) | 00:00:01 |  Q1, 02 | SVCP |            |

    |  14.               KIND OF BUFFER.                       |       |       |            |          |  Q1, 02 | ISSUE |            |

    |  15.                RECEIVE PX |                       |       |       |            |          |  Q1, 02 | SVCP |            |

    |  16.                 PX SEND HASH | : TQ10000 |       |       |            |          |        | S > P | HASH |

    |  17.                  NESTED LOOPS |                       |   823. 31274 |  1509 (1) | 00:00:01 |        |      |            |

    | * 18.                   TABLE ACCESS BY ROWID INDEX BATCH | PAGED_LOOKUP_PKS |   500 |  9500 |     3 (0) | 00:00:01 |        |      |            |

    | * 19.                    INDEX RANGE SCAN | PAGED_LOOKUP_PKS_IDX2 |     1.       |     2 (0) | 00:00:01 |        |      |            |

    |  20.                   TABLE ACCESS BY ROWID INDEX BATCH | BILL_ITEM |     2.    38.     4 (0) | 00:00:01 |        |      |            |

    | * 21.                    INDEX RANGE SCAN | BILL_ITEM_FK2 |     4.       |     2 (0) | 00:00:01 |        |      |            |

    | * 22.               INDEX UNIQUE SCAN | PK_INSERTION |     1.    13.     1 (0) | 00:00:01 |  Q1, 02 | SVCP |            |

    |  23.            ITERATOR BLOCK PX |                       |  1548K |    17 M |  1353 (2) | 00:00:01 |  Q1, 03 | ISSUE |            |

    |  24.             FULL RESTRICTED INDEX SCAN FAST | BOOKING_ACCOUNT_1 |  1548K |    17 M |  1353 (2) | 00:00:01 |  Q1, 03 | SVCP |            |

    |  25.         PX RECEIVE                                   |                       | 22037 |  1420K |    65 (2) | 00:00:01 |  Q1, 05 | SVCP |            |

    |  26.          PX SEND HASH | : TQ10004 | 22037 |  1420K |    65 (2) | 00:00:01 |  Q1, 04 | S > P | HASH |

    |  27.           SELECTOR PX |                       |       |       |            |          |  Q1, 04 | SCWC |            |

    |  28.            TABLE ACCESS FULL | CONTACT | 22037 |  1420K |    65 (2) | 00:00:01 |  Q1, 04 | SCWP |            |

    -----------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    7 - access ("ACCOUNT_ID" ="ACCOUNT_ID")

    10 - access ("BOOKING" ="BOOKING")

    18 - filter("T1".") SEQUENCE_NO' < 501 AND "T1". ("' SEQUENCE_NO" > = 1).

    19 - access("T1".") SESSION_ID '= 123456 AND 'T1'.' SEARCH_ID "= 25)

    21 - access("T1".") N1 "=" BILL_ID")

    22 - access ("BOOKING" = "BOOKING" AND "INSERTION_SET" = "INSERTION_SET" AND "INSERT"="INSERT")

    Note

    -----

    -the dynamic statistics used: dynamic sampling (level = 2)

    -This is an adaptation plan

    -2 directives Plan Sql used for this statement

    51 selected lines.

    Elapsed time: 00:00:00.15

    SQL > spool off

    OK, now let's go through the problem:

    1. It's a development running on a virtual server, and which hosts a few other databases, so the parallel execution is not a good thing. parallel_degree_policy is set to MANUAL, parallel_max_servers and all other parallel_ limits are set to 1 and tables have been changed with the settings of NOPARALLEL. So why is the execution plan always generated with all stages of parallel execution? I don't seem to get rid of in 12 c
    2. Next mystery is that the said plan of the explain command is an adaptation plan, and yet I put the true optimizer_adaptive_reproting_only
    3. Now to the problem of effective enforcement, so I'm playing around with all these settings. The query runs for 3-4 seconds, returning around about 500 cases. However, in some cases this same query with the same input variable races for hours and if I can believe the AWR and ASH reports, read a good 180 GB of data. The main wait event is direct path read temp temp and writing.


    This is not isolated to that one query. I have a few queries now that all display the same behavior, one of them running overnight. I don't seem to get to a standard nested loop execution plans.


    The entire base is a database plug-in and I don't know I just missed something in the new features Guide.

    Would appreciate some ideas.

    Thank you

    If you want to disable parallel execution, you must set parallel_max_servers to zero.  Maybe the optimizer thinks he can use a parallel plan because parallel_max_servers is non-zero (even though the number of slaves available means that it will be serialized to a parallel plan).

    Note that you have a ticket saying dynamic stats have been used.  Maybe you have a 11 for optimizer_dynamic_sampling setting, and allowing Oracle to be very inventive with collection of samples and parallelism.

    You have also 2 SQL instructions in game. These are the things that get associated with objects rather than the instructions, then perhaps someone has been playing with parallelism and managed to associate the parallelism with one of the tables in your query (I am not sure 100% that it is possible, just throw a suggestion).  Take a look at the SQL used for education guidelines.

    To give us a little more information, you can:

    Shoot memory execution plan dbms_xplan.display_cursor ({sql_id}, {number of children}, 'ALL'));

    We show all the parallel settings (see setting the parallel)

    Pull on the parameters of the optimizer for query memory (select name, value of V$ sql_optimizer_env where sql_id = {your sql identifier} and child_number = {your child number})

    Concerning

    Jonathan Lewis

  • Parallel execution of multiple scripts

    Hi all
    I understand that aid of parallels that we can achieve the parallel execution of the queries(insert/update/delete).
    Question of my today, I would like to know if parallelism can be achieved for the following scenario.

    I have a script with an insert select statement and multiple merge statements and a few updates statements all on the same table.
    I have to run this script 12 times on the same table, once for each month of the year.
    Currently, we run for Jan (where record_date = '201001') commit, then run for February and so on.

    Every 12 months can be executed in parallel. One way I can think is to create 12 different scripts and kicking around the opening 12 sessions SQL more (all on the same table).
    Is there a better way to do this?

    Note: the data for each month will not affect other other data month.

    Kind regards
    AJ

    Creation of 12 different scripts would be a suboptimal solution and a maintenance nightmare. 1 set script and call 12 times with different settings would be a little better.
    1 creating a stored procedure with parameters and execute that procedure in the 12 times Planner would be even better, because everything works on the side server only.

    Your description is deliberately vague, so the possibility of blocking cannot be excluded.

    ----------
    Sybrand Bakker
    Senior Oracle DBA

  • Free app with possible in-app purchase?

    Hello

    I think to release my latest creation, an application free, but with the possibility of in-app purchases. Is this possible? I know not due to the fact that free applications have no licenses.

    This is possible. I'm doing this for one of my games.

    http://appworld.BlackBerry.com/WebStore/content/26560

    You need a minimum of OS 1.0.6 for in-app purchases

  • Adding time to a stage of waiting with contacts inside?

    Let's say I have a wait time that lasts 7 days. And I have a contact that is in it for 3 days. I turn off the campaign, change step of 14 days and turn it back on. The contact that was in it runs after more than 4 days (the initial period when he entered the stage) or in 11 days?

    Thank you.

    Answer: 11 days.

    The program will assess step of waiting (with the most recent logic) before to pass the record of contact with the next step.

  • While trying to see Planner installation and operation, the test in local mode, the EXECUTION fails with message "Waiting for the number of virtual machines to register.

    While trying to see installation and operation Planner, the test in local mode with only 1 VM the EXECUTION fails with message "Waiting for the number of virtual machines to register.

    There may be a lot of problems in the desktop VM. Agent service see Planner is not running in VM Office. You can check in the event viewer to see what kind of error occurs. The most usual error missing file IP.txt c; drive or harness IP in the IP.txt produce if there is.

  • Whenever I started my PC a window pop up with the massege to allow execution of "WDBtnMgr.exePublisher".

    Every time I started my PC a window pop up with the massege allow execution of "WDBtnMgr.exePublisher"... allow or cancell are option 2 for a year I have to work and I just press Cancel I didn't see any restraint on the performance of the PC.

    Hello

    ·         What operating system is installed on the computer?

    ·         Did you make any changes before the show?

    Follow the methods and check them off below if it helps:

    Step 1: Start in safe mode and check if the problem persists:

    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode

    Step 2:

    If the problem does not persist in safe mode, then I suggest you put the computer in a clean boot and check if that helps:

    http://support.Microsoft.com/kb/929135

    Note: Reset the computer to start as usual by following step 7 from the link above.

    Step 3:

    Run the Microsoft safety scanner to make sure that the computer is free from virus infection:

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

  • info of parallel execution in the plan of the explain command

    In terms of explaining it, he learns you if a query is running in parallel? If so, what parts give you information about parallel execution?

    a parallel plan contains a large number of obvious differences if compared to a corresponding series plan: you should see a few operations beginning with the prefix of PX. In addition, it is more difficult to interpret a plane parallel (at least for me). Randolf Geist explains the basics (and more) in his informative article: parallel understanding - execution part 1.

  • Should I wait until the end of the execution time of the query for the execution plan?

    Hello Experts,

    I want to see the execution plan of the query below. However, it takes more than 3 hours. Should I wait all the time to see the execution plan?

    Note: EXPLAIN PLAN for does not work. (I mean that I do not see the actual line number, etc. with EXPLAIN the PLAN of market)

    You can see the output of the execution plan when I canceled the execution after 1 minute.

    My first question is: what should I do to see the execution plan for queries running out of time time?

    2nd question: when I cancel the query during execution in order to see the execution plan, will I see the specific plan of execution or erroneous values? Because the first execution plan seems inaccurate, what do you think?

    question 3: why EXPLAIN the PLAN for the clause does not work? Also, should I use EXPLAIN the PLAN of the clause to this scenerio? Can I see the result of running for long time without her queries?

    Thnaks for your help.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    PL/SQL Release 11.2.0.2.0 - Production

    CORE Production 11.2.0.2.0

    AMT for Linux: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price

    of custinvoicejour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) = substr (nls_lower (t.dataareaid), 1, 7) and

    substr (nls_lower (J.INVOICEID), 1: 25) = substr (nls_lower (t.INVOICEID), 1: 25)

    where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM = 29457

    and substr (nls_lower (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in

    (select IT. Drmpos.avtr_seg_cust_campend ACCOUNTNUM this where THIS. CAMPAIGN = '201406' and THIS. SEGMENT_LEVEL in (', 'E'))

    and J.AVAWARDSALES > 190

    and substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406'

    "and J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 ';

    SQL_ID, dznya6x7st0t8, number of children 0

    -------------------------------------

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT,.

    J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price of

    CustInvoiceJour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) =

    substr (nls_lower (t.DataAreaId), 1, 7) and

    = substr (nls_lower (J.INVOICEID), 1: 25)

    substr (nls_lower (t.INVOICEID), 1: 25) where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM =

    29457 and substr (nls_lower, (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in (select CE. ACCOUNTNUM of

    drmpos.avtr_seg_cust_campend this where THIS. CAMPAIGN = '201406' and

    IT. SEGMENT_LEVEL in (', 'E')) and J.AVAWARDSALES > 190 and

    substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406' and

    "J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 '.

    Hash value of plan: 2002317666

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                           | Begins | E - lines. A - lines.   A - time | Pads | Bed |  OMem |  1Mem | Used Mem.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                                |      1.        |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    |*  1 |  HASH JOIN |                                |      1.   3956.      0 | 00:00:00.01 |       0 |      0 |  2254K |  1061K | 2190K (0) |

    |*  2 |   HASH JOIN |                                |      1.     87.  16676. 00:00:01.64 |     227K |   3552.  3109K |  1106K | 4111K (0) |

    |*  3 |    TABLE ACCESS BY INDEX ROWID | CUSTINVOICEJOUR |      1.   1155 |  31889 | 00:00:01.16 |     223KO |     15.       |       |          |

    |*  4 |     INDEX RANGE SCAN | I_062INVOICEDATEORDERTYPEIDX |      1.   4943 |    134K | 00:00:00.83 |   45440 |      0 |       |       |          |

    |   5.    SIMPLE LIST OF PARTITION.                                |      1.  82360 |    173K | 00:00:00.08 |    3809 |   3537 |       |       |          |

    |*  6 |     TABLE ACCESS FULL | AVTR_SEG_CUST_CAMPEND |      1.  82360 |    173K | 00:00:00.06 |    3809 |   3537 |       |       |          |

    |   7.   TABLE ACCESS BY INDEX ROWID | CUSTINVOICETRANS |      1.   4560 |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    |*  8 |    INDEX RANGE SCAN | I_064INVLINENUMCAMPAIGNOFPRICE |      1.   4560 |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - access("J".") "SYS_NC00299$"="T". "' SYS_NC00165$ ' AND SUBSTR (NLS_LOWER ('J'. "" "" REFFACTURE")(, 1, 25) = SUBSTR (NLS_LOWER ("T"." "" "REFFACTURE")(, 1, 25)).

    2 - access("J".") INVOICEACCOUNT '= SYS_OP_C2C ("EC". ". ACCOUNTNUM'))

    3 - filter("J".") AVAWARDSALES"> 190)

    4 - access("J".") SYS_NC00299$ "= U ' 201"AND "J". INVOICEDATE"> = TO_DATE(' 2014-06-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND

    "J"." SYS_NC00307$ "= U ' 201406"AND "J". INVOICEDATE"< = TO_DATE (' 2014-06-13 00:00:00 ',' syyyy-mm-dd hh24:mi:ss')))

    filter ((' J'. "INVOICEDATE' > = 'J' AND TO_DATE(' 2014-06-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss') '." " SYS_NC00307$ "= U '201406' AND"

    "J"." INVOICEDATE"< = TO_DATE (' 2014-06-13 00:00:00 ',' syyyy-mm-dd hh24:mi:ss'))))

    6 filter (("CE". "SEGMENT_LEVEL" = A "OR"THIS"." SEGMENT_LEVEL "=" E"))

    8 - access("T".") SYS_NC00165$ "= U ' 201"AND "T". AVBROCHURELINENUM "= 29457)

    filter ("T". ("AVBROCHURELINENUM" = 29457)

    EXPLAIN PLAN FOR

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price

    of custinvoicejour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) = substr (nls_lower (t.dataareaid), 1, 7) and

    substr (nls_lower (J.INVOICEID), 1: 25) = substr (nls_lower (t.INVOICEID), 1: 25)

    where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM = 29457

    and substr (nls_lower (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in

    (select IT. Drmpos.avtr_seg_cust_campend ACCOUNTNUM this where THIS. CAMPAIGN = '201406' and THIS. SEGMENT_LEVEL in (', 'E'))

    and J.AVAWARDSALES > 190

    and substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406'

    "and J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 ';

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR);

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR ('7h1nbzqjgwsp7', 2));

    SQL_ID, 7h1nbzqjgwsp7, number of children 2

    EXPLAIN PLAN for select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * /.

    J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE,

    (T.LINEAMOUNT + T.LINEAMOUNTTAX) join price j custinvoicejour

    CustInvoiceTrans t on substr (nls_lower (j.dataareaid), 1, 7) =

    substr (nls_lower (t.DataAreaId), 1, 7) and

    = substr (nls_lower (J.INVOICEID), 1: 25)

    substr (nls_lower (t.INVOICEID), 1: 25) where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM =

    29457 and substr (nls_lower, (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in (select CE. ACCOUNTNUM of

    drmpos.avtr_seg_cust_campend this where THIS. CAMPAIGN = '201406' and

    IT. SEGMENT_LEVEL in (', 'E')) and J.AVAWARDSALES > 190 and

    substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406' and

    "J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 '.

    NOTE: cannot fetch SQL_ID plan: 7h1nbzqjgwsp7, CHILD_NUMBER: 2

    Check the value of SQL_ID and CHILD_NUMBER;

    It could also be that the plan is no longer in the cursor cache (check v$ sql_plan)

    NightWing wrote:

    Randolf,

    I don't understand. What you hear from the above statement that you mean A-lines and E will be incorrect, but the ratio between them remain the same. Therefore, you can deduct the bad things by comparing the differences.

    Thus, A-lines always give a wrong result for cancellation of queries, isn't it?

    Charlie,

    I think that Martin gave a good explanation. Here's another example that hopefully makes more obvious things:

    17:56:55 SQL >-things go very wrong here with a small buffer cache

    17:56:55 SQL >-T2 lines are badly scattered when you access through T1. FK

    17:56:55 SQL >--

    17:56:55 SQL >-"Small job" approach would have been a good idea

    17:56:55 SQL >-if the estimate of 100 iterations of the loop was correct!

    17:56:55 SQL > select

    17:56:55 (t2.attr2) count 2

    17:56:55 3 of

    17:56:55 4 t1

    17:56:55 5, t2

    17:56:55 6 where

    17:56:55   7  /*------------------*/

    17:56:55 8 trunc (t1.attr1) = 1

    17:56:55 9 and trunc (t1.attr2) = 1

    17:56:55 10 / *-* /.

    17:56:55 11 and t1.fk = t2.id

    17:56:55 12.

    T1

    *

    ERROR on line 4:

    ORA-01013: user has requested the cancellation of the current operation

    Elapsed time: 00:04:58.30

    18:01:53 SQL >

    18:01:53 SQL > @xplan_extended_display_cursor ' ' ' ' 'ALLSTATS LAST + COST.

    18:01:53 SQL > set echo off verify off termout off

    SQL_ID, 353msax56jvvp, number of children 0

    -------------------------------------

    SELECT count (t2.attr2) from t1, t2 where

    / / *-* trunc (t1.attr1) = 1 and

    trunc (T1.attr2) = 1 / *-* / and t1.fk = t2.id

    Hash value of plan: 2900488714

    ------------------------------------------------------------------------------------------------------------------------------------

    | ID | The NEST | DSB | Operation | Name | Begins | E - lines. Cost (% CPU). A - lines.   A - time | Pads | Bed |

    ------------------------------------------------------------------------------------------------------------------------------------

    |   0 |     |   7. SELECT STATEMENT |        |      1.        |  4999 (100) |      0 | 00:00:00.01 |       0 |      0 |

    |   1.   0 |   8 2 GLOBAL TRI |        |      1.      1.            |      0 | 00:00:00.01 |       0 |      0 |

    |   2.   1.   5.   NESTED LOOPS |        |      1.        |            |  57516 | 00:04:58.26 |     173K |  30770 |

    |   3.   2.   3.    NESTED LOOPS |        |      1.    100.  4999 (1) |  57516 | 00:00:21.06 |     116K |   3632.

    |*  4 |   3.   1.     TABLE ACCESS FULL | T1 |      1.    100.  4799 (1) |  57516 | 00:00:00.19 |    1008 |   1087 |

    |*  5 |   3.   2.     INDEX UNIQUE SCAN | T2_IDX |  57516 |      1.     1 (0) |  57516 | 00:00:20.82 |     115K |   2545 |

    |   8 2 2 |   4.    TABLE ACCESS BY INDEX ROWID | T2 |  57516 |      1.     2 (0) |  57516 | 00:04:37.14 |   57516 |  27138 |

    ------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    4 filter ((TRUNC ('T1'. "ATTR1") = 1 AND TRUNC ('T1'. " ATTR2') = 1))

    5 - access("T1".") FK '= 'T2'.' (ID')

    You say here that I canceled a query after about 5 minutes, and looking at the statistics of content (RowSource) I can already say the following:

    1. the estimation of cardinality of T1 is far - the optimizer estimated 100 lines, but it actually generated more than 57000 lines when the query was cancelled. If this definitely seems like a candidate at the origin of the problems

    2. the query has spent most of the time in search of random table T2

    So while it is true that I don't know final A-lines of this cancelled query information, I can still say a lot of this and begin to deal with the problems identified so far.

    Randolf

  • With the help of DAC for running no BIApps infa jobs n 2 EP running in parallel

    Hello

    We already have configuration BI Apps prod environment using DAC, Informatica and OBIEE 11 g for one of our customers.

    Now, we want to check the possibility of using the DAC for the execution of BIApps no informatica related jobs.
    (That we had only a week of the execution plan of DAC weekend and Informatica and DAC are inactive most of the time during the week)

    Customer wants a separate new small datamart be configured which meet the requirements of statement for different departments and has no links of kinship or any link with existing BI Data Warehouse applications.

    I just wanted to check if it will violate the license terms (if we use CAD to workflows not BI Apps and run another EP)?

    In addition, the DAC Build 10.1.3.4.1 is capable of running two parallel execution plans?

    We have heard long back that two parallel feature EP will be lunched in the version 11g CAD. Pointers or new in this space?

    Thanks in advance,

    From what I remember, you cannot load a 'distinct' DB instance that is NO OLIVIER. If you create a small custom datamart on the INSIDE of the OLIVIER exitsing schema, then it is acceptable. However, if you use DAC (no matter if its plan one or two plans) to load a NON-OBIA target, this may violate the license agreement. You need a self-contained separate license for Informatica and use the planner of Informatica tool. If you want to use DAC, ensure that your target is inside the DW OBIA.

    Pls correct brand...

  • appropriate using index for the execution of the parallel statement

    Hi all

    I created indexes for my table
    CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);
    That was before I started thinking about the execution of the parallel statement. As far as I've heard I need to change my correct use with parallel hint index. Could you please suggest the way forward?

    Marco wrote:
    Hi all

    I created indexes for my table

    CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);
    

    That was before I started thinking about the execution of the parallel statement. As far as I've heard I need to change my correct use with parallel hint index. Could you please suggest the way forward?

    When all else fails, read the Fine

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/sql_elements006.htm#autoId63

Maybe you are looking for

  • Satellite Pro M40: CD/DVD multi recorder - unable to read or burn movie data

    HelloThis recorder satellite pro m-40, is strange; I am able to boot from the dvd, read data DVDs, burn a cd, but, unable to read or write data (original) film; I already try with a few movies from dvd without success!Any idea? Thank you! Ronald

  • Satellite Pro A100: Upgrading RAM void my warranty?

    I just bought a Toshiba Satellite Pro A100 today and, having only 256mbRAM I want to update my 512 RAM. If I discover the RAM slots and replace it, this will void my warranty? Thank you (NB several opinions would be appreciated)

  • Ping GS752TP Cant VLAN IP

    I have a switch are not currently connected to the network, which will be repalce one switch of aging there address static IP address 10.100.6.225 and created a virtual local network 50 that will be for the devices of shoretel, put in place a VIRTUAL

  • HP deskjet 3050 j611

    I just installed hp deskjet 3050 a j611 operating system is MAC OS X 10.6.8 can't print wireless "host network busy" is displayed if try and print information from IP address it prints wireless what settings are missing

  • BSOD while playing games or made

    Hello. My custom PC started getting blue death screen when ever I play a modern game or make things in a blender. I tried Memtest and it did not find anything. I tried the built in hard disk check tool and it also did not find anything. I've also upd