Execution of sequential operations to parallel groups of Threads

I have the following scenario, which must be changed as soon as possible:
1. a group of sequential threads runs (contains 3-wire)
2. a sequential group of other threads is running (contains 2-wire)
3. a group of parallel threads is running (contains 9 wires such as producers and consumers of threads applied properly)

Why I created this scenario?
To run a particular thread first (point-1: containing 3-wire), after their treatment is done I needed to run another 2-wire (point-2: containing 2 wires). If and only if 1 and 2 points are covered, I required to deal with-3 points.

Initially, I required to run all threads for parallel operations, but I left this idea that parallel threads are run simultaneously.

For the situation described above everything works smoothly until there was a problem.

Why do I need to change the above scenario?
Sometimes, I get an Exception that can be handled well in the case of parallel threads. While the same Exception if I get in the sequential threads that becomes unmanageable. Since then, all other sequential treatments of threads comes under condition of waiting until the end of the first.


So, I need to take advantage of the parallel threads, but I chose this path to be easy which became difficult to handle the situation for the application.
So, I need to create such a scenario, in which I need to run different parallel threads for a fixed order. For example:
Order-1 = process the first 3 parallel threads
Order-2e = process 2 parallel threads
Order-3e = process the next 9 parallel threads

Also, the above case is somewhat limited, although I need a generic solution for this. As if in the future, I want to add more than 2-wire command-1 or if I remove still some discussions for any order must be execution of the sequence of groups as you want.
Is it possible in java through which we can make a group of parallel threads that can be executed to order we can specify?

I have the code snippet following, if you can help me to change:

Level-1

[] Thread = Thread [list1.size (new)];
int j = 0;
{for (List1.Size ())}
Object delegator1 = new Object("Level-1");
Thread th = new Thread (delegator1);
discussions [j] = th;
Th.Start ();

j ++ ;
}
for (thread Threading: thread) {}
thread. Join();
}

Level-2

son = new Thread [list2.size ()];
j = 0;
{for (List2.Size ())}
Object delegator2 = new Object("Level-2");
Thread th = new Thread (delegator2);
discussions [j] = th;
Th.Start ();

j ++ ;
}
for (thread Threading: thread) {}
thread. Join();
}

Level 3 & 4-> producer-consumer applied using wait-notify works very well.

{for(list3.) Size())}
Object delegator3 = new Object ("level 3 & 4")
Thread th = new Thread (delegator3);
Th.Start ();
}

I want these different levels to run at the same time but if first level finishes off the second level must eventually runs.

Published by: 990484 on February 26, 2013 09:45

If you just want to wait for a set of threads end, for example, use a CountDownLatch in the main thread, initialized to the number of threads. The main thread waits then each thread to complete and to warn the latch.

Repeat for the next series.

Tags: Java

Similar Questions

  • Operation - synchronize input group 1

    Hi all

    I am facing a problem in a set operation - Union all the.

    I have two large tables, but the order of the columns is not the same.

    Example of
    I have table_1 which is

    A B C D E

    and table_2, which is

    B C D E

    And the data types are the same.


    When I use the operator, the release group looks like this.

    A
    B
    C
    D
    E
    A_0
    B_0

    There is an option where you can synchronize entry group 2 Group 1 entry, but it does not work.
    Have you faced this situation? How to solve it?

    Thanks in advance!
    Sebastian

    Yes the sync works for me.

    I think firstly connect a group then
    After that, use sync.

  • Automation of the operations of the group security Shared Services - Add / Remove / outsource

    Hello

    Is it possible to automate, add / outsource / remove users (external user) from a security group?

    Earlier, I used to do this with MXL (change user...) but it seems that this approach is not taken in charge of 11.1.2.4 from.

    Thank you...

    There are a lot of messages and articles on LCM, everything you need to do is a little research.

    There is also documentation of LCM - life cycle management

    The LCM of SSP import options are available to- States Migration native Directory Import Options

    What I recommend is to do the research, run an export of LCM of SSP, throw an eye on the format, have a look at the options available, create your import files, import into shared Services.

    Once you are satisfied, you can start seek to automate using the LCM, the information is in the documentation link I provided

    See you soon

    John

  • Conflicting child tasks when operating in parallel

    I am new to ODI and trying to run two child tasks in parallel using asynchronous Mode. Problem is that, after the start of these two jobs, the parent task is complete. The child jobs are generally 15-2-minutes to complete. If I schedule the parent task to begin after every 10 minutes, then re-run the parent starts child jobs while the child jobs of previous tracks are still running. Please help how I can make the child jobs of second run to start when the jobs of the child of the first round is over.

    In the parent task use utility ODI - OdiWaitForChildSession. This will make your session parent to wait for the sessions of the child, and your second session of parent will not start before the end of the first session of parent child sessions.

  • Problems during execution of a LabVIEW VI in a new thread under TestStand sequence and execution of the MainSequence in step by step mode

    Hello

    We want to run a VI in LabVIEW (LV2011) at the same time to the execution of a sequence of test of TestStand (TS2010). The VI should view the condition of the equipment, while the test sequence is written in TestStand. It would be a nice feature of debugging the TestStand sequence while watching the State of the material in the LabVIEW Panel, too.

    This is where it's our problem. Imagine that you have a MainSequence calling a subsequence in a new thread, which runs the LabVIEW VI. After the call, the MainSequence continues its progression, as it is configured to do this. But if we want to execute the MainSequence in step parallel execution of VI mode, we can do that. The controls for "Step Out" etc. are grey.

    I tried to build a very simple example to explain what I mean. It's just a sequence and a LabVIEW VI, no real functionality, just take as an example for our problem.

    Any tips? What we're doing wrong? Is there something that needs to be changed in the LabVIEW VI?

    Best regards

    Manual

    You should use the monitor of the termination and the ExternallySuspended APIs for the EIS to running asynchronously. There are screws of wrapper around these APIs in the LabVIEW TestStand palette.

    For more details see using the API for the following:

    Thread.ExternallySuspended

    Execution.InitTerminationMonitor

    Execution.GetTerminationMonitorStatus

    Unless I am struggling to understand what you're asking, if you are using these APIs, you should be able to make it work as you are eager to do things.

    -Doug

  • Question from ParallelFunction in pipeline

    Hi all

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0

    I created a parallel activated function of pipeline within a packet, what download of data and write to a file using UTL_FILE.

    But when I run it with Select * from TABLE (pipeline_function...) parallel on the slider, it is not run on parallel with suspicion (because it generates several files).

    Here is the code of function of pipeline and select the statement that I used with the release.

    -Function is located in the package EXTRACT_PKG

    FUNCTION PARALLEL_EXTRACT)

    p_source IN SYS_REFCURSOR,

    P_FILENAME IN VARCHAR2,

    P_DIRECTORY IN VARCHAR2,

    P_EXTRACT_TP VARCHAR2,

    p_limit_size extract_pkg IN DEFAULT PLS_INTEGER. C_DEFAULT_LIMIT)

    RETURN EXTRACT_NTT

    PARALLEL_ENABLE IN PIPELINE (P_SOURCE BY ANY PARTITION) AS

    Row_aat. ARRAY TYPE IS VARCHAR2 (32767)

    INDEX BY PLS_INTEGER;

    aa_rows row_aat;

    v_sid NUMBER: = SYS_CONTEXT ('USERENV', 'SID');

    v_Name VARCHAR2 (128): = p_filename | '_' || v_sid | ".txt";

    v_file UTL_FILE. TYPE_DE_FICHIER;

    v_lines PLS_INTEGER;

    BEGIN

    -LOG_DETAILS(VG_FILE,' Writing to the file '|| v_Name ||' commencé...');

    v_file: = UTL_FILE. FOPEN (p_directory, v_name, 'w', 32767);

    LOOP

    Get the p_source COLLECT LOOSE aa_rows LIMIT p_limit_size;

    WHEN aa_rows EXIT. COUNT = 0;

    BECAUSE me in 1... aa_rows. COUNTING LOOP

    UTL_FILE. Put_line (v_file, aa_rows (i));

    END LOOP;

    END LOOP;

    V_LINES: = P_SOURCE % ROWCOUNT;

    -LOG_DETAILS(VG_FILE,' '||) V_LINES | "lines were written on the file ' |" v_Name);

    CLOSE P_source;

    UTL_FILE. FCLOSE (V_FILE);

    PIPE ROW (extract_ot (v_name, v_lines, v_sid, p_extract_tp));

    RETURN;

    END parallel_extract;

    -The query

    SELECT / * + PARALLEL (b, 4) * / *.

    table)

    EXTRACT_PKG.parallel_extract (CURSOR (SELECT / * + parallel (t 4) * /))

    T.OBJECT_NAME

    OF IK_TEMP_MFI T).

    "iktest,"

    "EXTRACT_DIR", "IFM")) b;

    -Output - shows that a single file - should be several files

    File_name No_Records SID Extract_type

    200000 269 IFM iktest_269.txt

    Can someone tell me why it is not run in parallel?

    Are there system/session level settings should be set to?

    Don't confure parallelization of a single operation with the execution of several operations in parallel. PARALLEL_ENABLE parallelizes operations DML, nothing more. You can check the DBMS_PARALLEL_EXECUTE package.

    SY.

  • execution for FPGA parallel code problem

    Hello

    I have a problem with the execution of the code in parallel on the FPGA to a cRIO-9073.
    Running the code takes more time than expected.
    The problem is described in the attached PDF file.

    Kind regards

    Beurms Jasper

    Hi Jasper,.

    the first problem is due to DATA streams! THINK THE STREAM!

    You have three simultaneous sequences. The loop iteration time depends on the slowest component in the loop. If you don't need to ask why the 'low frequency sequence' minimalist other sequences?

    The 2nd problem cannot be discussed looking at the pictures. What are those who wait function? milliseconds, microseconds, ticks?

    Did you know that the IO nodes also take some time to treatment?

  • Parallel recovery in RMAN?

    O.S: OEL 5.5

    DB version: 11.2.0.3

    Hello Experts,

    I have some doubts on the recovery RMAN. I would like to know your opinion of experts.

    (1) process that performs the RMAN recovery (just as the MRP in standby).

    (2) I always thought that recovery is a sequential task. This thread (parallel recovery) saved my theory. However, I see RMAN commands likeRMAN>recover database parallel 4 . So what is the parallel option used for?

    (3) if the recovery is a sequential process, how can we have several MRP process on the side of Eve (PHYSICS: why recovery managed to reproduce so many slaves?) (Doc ID 885872.1).

    Thank you very much in advance.

    Satya

    (1) so the "server process" began with the RMAN dealing with recovery too? Please correct me.

    RMAN Utility is just a customer.

    RMAN connect to the database and execute commands, all the work is done on the server side. Server database always process take care of backup/restore/recovery.

    (2) automatic channels is also used for the recovery and restoration? I always manually assign during the restore and recovery.

    N ° auto-channel is reserved for backup and restore operations.

    RECOVERY operation (aka Media Recovery) is different from the command RECOVER, because the execution process of recovery RECOVER command also trigger archivelogs of RESTORATION, and RECOVERY process apply that Redo on data files.

    Recovery operation is managed by * parallel * parameters not automatic channels.

    (3)'with the resumption of parallel media, these blocks of data are subsequently distributed evenly to all recovery processes to read into the buffer cache. "--> Does this mean that the recovery of the parallel media is intended to copy multiple blocks in parallel to the memory buffer uses cache ONLY. However, the recovery process (applying the vectors of change) is a sequential process? Please correct me

    The writing is not all sequential process, but each block of data is retrieved sequentially.

    Parallel media recovery, the database uses a 'division of labour' approach to allocate different processes at different data blocks while rolling forward, which makes the process more effective.

  • run a subsequence (or a few) in a thread in a parallel model

    I have several threads running - I want that the first turning a device of some on and the rest of them just jump this subsequence.

    Rather than designing a system of flags - I was hoping there is a way to fix the synchronization behavior similar to the option to synchronize batch of 'a thread only "?

    Is it possible to have the entire sequence by the collar of the stage at the end which turned off the camera and the last of them, execution of the tower off?

    Hi rsmrostov.

    See this topic: http://forums.ni.com/t5/NI-TestStand/Implementation-of-synchronization-steps-without-using-batch-or/...

    Batch synchronization step types only works when you use the process model of batch processing (without extra implementation on your part to synchronize the threads running in parallel process model).

    TestStand provides batch step specification to define a group of threads; to perform a synchronization batch in a non - batch process template. See the file attached sequence for a reference to an implementation using the specification of the batch steps.

    -Jeff

  • Process "parallel."

    I don't think I've ever had it answered... I run a functional test (LV2014... Win 7.DAQ6229) in the functional test.vi is a structure flat seq.  In each seq is a Subvi... subvi1 can subvi2 etc.  Each of these subvis I use the DAQ to measure DIO/voltages...etc. for my test of the UUT.  Is there a way in ethier the functional test.vi or the subvis to monintor a Boolean that stops at the functional vi?  Looking for a way to have the acquisition of data running its thing...... running test and monitor a door switch (Boolean) so that if the user opens the door to the test set it stops the test and lights an LED to software that I put on the Panel before the functional test GUI.  I know how to implement Boolean... I know how to implement functional tests.   I don't know how to combine them so that they are both running at the same time.

    Thank you...

    In my example, you want to run sub - VI 1 and 2 Subvi sequentially in a Structure of sequence (in fact totally useless when wired as in my example, because sequential operation is applied by stream), but you want one of them to be able to respond to a gate change event.  The door switch is modeled as a Boolean control ("Door Switch") on the Panel front of high level VI.

    Let's say for example that you were in the Middle running of the actions of the Subvi 1 (it has a structure of business state machine defined in the diagram of the Structure of its event delay) when the door switch is open (in this model, the Boolean switch door control in the Top level VI is pressed).  A value change event is triggered, which is queued to the registration of the event we did in the Top level VI.  Because the Structure of the Subvi 1 event has this listing of events connected to its dynamic Terminal and has a diagram that is assigned to manage the event, this diagram executes the next iteration of its inside while loop.  This schema defines its next State to be a door switch stop action E.  On the next iteration of its inside while loop: it runs the diagram of the Structure of the event delay; then runs the door switch diagram E stop the confined case of machine state structure. who takes care of stopping / cleaning that must happen, sets an error and ends the while loop.  Now Subvi 1 returns Subvi 2 runs but does nothing because of the mistake of Subvi 1 and then we return to the Top level VI and complete execution.

  • boards of opt_estimate in the merge of refresh operations quick mview

    Hello

    in a system (Oracle 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production database) I'm trying to optimize, there are materialized views with "fast refresh on commit" and there are many queries to the following distribution:

    / * MV_REFRESH (MRG) * / MERGE INTO "XXX". "" WITH THE HELP OF YYY "" SNA$ ' (SELECT / * + OPT_ESTIMATE (QUERY_BLOCK MAX = 485387) * /...)

    "As far as I can see the queries show the structure explained in Alberto Dell's Oracle blog'Era ' quick refreshment of only materialized aggregate views with SUM - algorithm (in the section" Refresh for mixed-DML TMPDLT") - the best resource on refresh mview algorithms I know. But I could not find information on the setting of the OPT_ESTIMATE indicator. In the database, I see that the values in the indicator are changing:

    Select st.sql_id

    , substr (st.sql_text, instr (st.sql_text, 'OPT_ESTIMATE'), 40) sql_text

    St dba_hist_sqltext

    where st.sql_text like ' / * MV_REFRESH (MRG) * / MERGE INTO "XXX". » YYY » %'

    and...


    SQL_ID SQL_TEXT

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

    6by5cwg0v6zaf OPT_ESTIMATE (QUERY_BLOCK MAX = 485387) *.

    2b5rth5uxmaa2 OPT_ESTIMATE (QUERY_BLOCK MAX = 485387) *.

    4kqc15tb2hvut OPT_ESTIMATE (QUERY_BLOCK MAX = 490174) *.

    fyp1rn4qvxcdb OPT_ESTIMATE (QUERY_BLOCK MAX = 490174) *.

    a5drp0m9wt53k OPT_ESTIMATE (QUERY_BLOCK MAX = 407399) *.

    2dcmwg992pjaz OPT_ESTIMATE (QUERY_BLOCK MAX = 485272) *.

    971zzvq5bdkx6 OPT_ESTIMATE (QUERY_BLOCK MAX = 493572) *.

    46434kbmudkq7 OPT_ESTIMATE (QUERY_BLOCK MAX = 493572) *.

    4ukc8yj73a3h3 OPT_ESTIMATE (QUERY_BLOCK MAX = 491807) *.

    8k46kpy4zvy96 OPT_ESTIMATE (QUERY_BLOCK MAX = 491807) *.

    3h1n5db3vdugt OPT_ESTIMATE (QUERY_BLOCK MAX = 493547) *.

    5340ukdznyqr6 OPT_ESTIMATE (QUERY_BLOCK MAX = 493547) *.

    7fxhdph8ymyz8 OPT_ESTIMATE (QUERY_BLOCK MAX = 407399) *.

    15f3st5gdvwp3 OPT_ESTIMATE (QUERY_BLOCK MAX = 491007) *.

    083ntxzh8wnhg OPT_ESTIMATE (QUERY_BLOCK MAX = 491007) *.

    cg17yjx3qay5z OPT_ESTIMATE (QUERY_BLOCK MAX = 491452) *.

    5qt37uzwrwkgw OPT_ESTIMATE (QUERY_BLOCK MAX = 491452) *.

    byzfcg7vvj859 OPT_ESTIMATE (QUERY_BLOCK MAX = 485272) *.

    aqtdpak3636y5 OPT_ESTIMATE (QUERY_BLOCK MAX = 493572) *.

    dcrkruvsgpz3u OPT_ESTIMATE (QUERY_BLOCK MAX = 492226) *.

    7mmt5px6sd7xg OPT_ESTIMATE (QUERY_BLOCK MAX = 492226) *.

    9c6v714pbjvc0 OPT_ESTIMATE (QUERY_BLOCK MAX = 485336) *.

    fbpsz02yq2qxv OPT_ESTIMATE (QUERY_BLOCK MAX = 485336) *.

    0q04g2rh9j84y OPT_ESTIMATE (QUERY_BLOCK MAX = 491217) *.

    gp3u5d5702dpb OPT_ESTIMATE (QUERY_BLOCK MAX = 491638) *.

    9f35swtju24aa OPT_ESTIMATE (QUERY_BLOCK MAX = 491638) *.

    a70jwxnrxtfjn OPT_ESTIMATE (QUERY_BLOCK MAX = 491217) *.

    93mbf02cjq2ny OPT_ESTIMATE (QUERY_BLOCK MAX = 491217) *.

    Then of course the cardinalities in the OPT_ESTIMATE indication are not static here and the sql_id of foreign exchange as a result. And this change prevents me from using the basic lines of sql plan to gurantee a stable path (essentially to avoid the parallel operations for refresh, well operations that Parallels access for queries do not prevent). I did a quick check with 11.2.0.1 and see the same model here:

    drop materialized view t_mv;

    drop table t;

    create table t

    as

    Select rownum id

    , mod (rownum, 50) col1

    , mod (rownum, 10) col2

    , lpad ('* ', 50,' *') col3

    of the double

    connect by level < = 100000;

    exec dbms_stats.gather_table_stats (user, 't')

    Create materialized view log on t with rowid (id, col1, col2, col3) including the new values;

    Create materialized view t_mv

    quickly refresh on validation

    as

    Select col1

    sum (col2) sum_col2

    count (*) NTC

    count (col2) cnt_col2

    t

    Col1 group;

    Update t set col2 = 0 where col1 = 1;

    commit;

    SQL_ID, 4gnafjwyvs79v, number of children 0

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

    / * MV_REFRESH (MRG) * / MERGE IN 'TEST '. "" T_MV ""$SNA"WITH THE HELP OF SELECT (SELECT

    / * + OPT_ESTIMATE (QUERY_BLOCK MAX = 1000) * / "DLT$ 0. "" COL1 ""GB0. "

    SUM (DECODE ("DLT$ 0". "DML$ $"(, 'I', 1,-1) * DECODE ("DLT ($0". " ("" COL2 ").

    (NULL, 0, 1)) 'D0', SUM (DECODE ("DLT$ 0". "DML$ $"(, 'I', 1,-1)) 'D1', "

    NVL (SUM (DECODE ("DLT$ 0". "DML$ $"(, 'I', 1,-1) * ("DLT$ 0". " ((("" COL2 ")), 0)

    'D2' FROM (SELECT CHARTOROWID (' MAS$ ".)) ("' M_ROW$ $') RID$,.

    "MAS$". " "COL1", "MAS$". "' COL2 ', DECODE (" MAS$ ".) OLD_NEW$ $, 'N', ' (I ' 'd').

    DML$ $, "MAS$". "" DMLTYPE$ $"" DMLTYPE$ $', 'TEST '. "" MLOG$ _T "" MAS$ ".

    WHERE "MAS$". XID$ $ =: 1) 'DLT$ 0' GROUP BY 'DLT$ 0. ("' COL1 ')" AV$ "ON

    (SYS_OP_MAP_NONNULL ("SNA$".)) ("' COL1 ') = SYS_OP_MAP_NONNULL (" AV$ ".) (("" GB0 '))

    WHEN MATCHED THEN UPDATE SET "SNA$". "CNT_COL2"= "$SNA". «CNT_COL2 "+" AV$ ".»

    'D0', '$SNA '. "CNT"= "$SNA". «CNT "+" AV$ ".» "' D1 ',.

    "SNA$". " SUM_COL2 "= DECODE (" SNA$ "". ")" CNT_COL2 "+" AV$ ".» D0', 0, NULL, NVL ("SNA$".)

    ("SUM_COL2", 0) + AV$ «» ("' D2 ') DELETE WHERE (" SNA$ ".) ("' CNT ' = 0) IS NOT

    MATCHED THEN INSERT ("SNA$".) "" COL1 ","$SNA ". "" CNT_COL2 ","$SNA ". "" CNT ",.

    Hash value of plan: 2085662248

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

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

    |   0 | MERGE STATEMENT |         |       |       |    24 (100) |          |

    |   1.  MERGE | T_MV |       |       |            |          |

    |   2.   VIEW                  |         |       |       |            |          |

    |*  3 |    OUTER HASH JOIN |         |    40.  4640 |    24 (9) | 00:00:01 |

    |   4.     VIEW                |         |    40.  2080.    20 (5) | 00:00:01 |

    |   5.      GROUP SORT BY |         |    40.  1640 |    20 (5) | 00:00:01 |

    |*  6 |       TABLE ACCESS FULL | MLOG$ _T |    40.  1640 |    19 (0) | 00:00:01 |

    |   7.     MAT_VIEW FULL ACCESS | T_MV |    50.  3200 |     3 (0) | 00:00:01 |

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

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

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

    3 - access (SYS_OP_MAP_NONNULL ("SNA$".)) ("' COL1 ') = SYS_OP_MAP_NONNULL (" AV$ ".) "G

    B0'))

    6 - filter("MAS$".") XID$ $"(=:1)"

    Note

    -----

    -dynamic sample used for this survey (level = 2)

    So I see an OPT_ESTIMATE (QUERY_BLOCK MAX = 1000) and this estimate seems to be fairly stable when I change the number of lines, number of blocks, use partitioning etc. I checked a trace with Event 10046 but didn't source the value 1000. I also disabled the comments of cardinality ("_optimizer_use_feedback" = false) and there is no profile sql in my system (according to dba_sql_profiles) - but the OPT_ESTIMATE is still there.

    So the question is: is there something known about values used in the OPT_ESTIMATE indication for the materialized view fast refresh operations? Thanks in advance for your contributions.

    Concerning

    Martin Preiss

    Martin Preiss wrote:

    In regard to point 1: initially as a partitioned table starting with K 1000 lines, then 100K, then 10K, I created my test T table (using my old example of Blog Oracle MP: Materialized View Fast refresh): in all cases, I got OPT_ESTIMATE (QUERY_BLOCK MAX = 1000). My first problem in this context is that I did not come with a model showing different OPT_ESTIMATE values - as I see them in the prod system.

    Using the sql Profiler and the force_match option looks promising - I'll check if I can use them here.

    Concerning

    Martin

    Hi Martin,

    but perhaps the OPT_ESTIMATE indicator is based on stats of the MLOG or MV table, where my question. Since this is the option to 'MAX' of OPT_ESTIMATE (limit the maximum number of rows for this query block) the 1000 resembles 'low' default value is used if the stats are missing or the MLOG / MV table less than 1000 lines?

    Randolf

  • Query execution plan

    Hi all

    It is stated:
     
    For example for qid=-4 takes 3 min 20 sec.
    
    SELECT id, org, count(aa) cnt
    FROM (SELECT DISTINCT id, org, aa
          FROM zzz_temp_nn, molfrelflat, (SELECT DISTINCT m.prot aa, nvl
    (org, 0) org, molf tid FROM molfprot m, (SELECT DISTINCT prot, org FROM 
    protorgs WHERE trust >= 0 AND decode(org, 0, 0, 1) = 1) o WHERE m.prot 
    = o.prot(+))
          WHERE qid = -4 AND id = molfgrp AND molfmbr = tid)
    GROUP BY id, org
    
    no rows selected
    
    Elapsed: 00:03:20.41
    
    
    
    Execution plan:
    
    -------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                                | Name                         | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                         |                              |     1 |    39 |    29   (7)| 00:00:01 |
    |   1 |  HASH GROUP BY                           |                              |     1 |    39 |    29   (7)| 00:00:01 |
    |   2 |   VIEW                                   |                              |     1 |    39 |    28   (4)| 00:00:01 |
    |   3 |    HASH UNIQUE                           |                              |     1 |   133 |    28   (4)| 00:00:01 |
    |   4 |     NESTED LOOPS                         |                              |     1 |   133 |    27   (0)| 00:00:01 |
    |   5 |      NESTED LOOPS                        |                              |     1 |   128 |    26   (0)| 00:00:01 |
    |   6 |       NESTED LOOPS                       |                              |     1 |   123 |    25   (0)| 00:00:01 |
    |   7 |        NESTED LOOPS                      |                              |     1 |   118 |    24   (0)| 00:00:01 |
    |   8 |         NESTED LOOPS                     |                              |     1 |   113 |    23   (0)| 00:00:01 |
    |   9 |          NESTED LOOPS                    |                              |     1 |   102 |    21   (0)| 00:00:01 |
    |  10 |           NESTED LOOPS                   |                              |     1 |    91 |    19   (0)| 00:00:01 |
    |  11 |            NESTED LOOPS                  |                              |     1 |    80 |    17   (0)| 00:00:01 |
    |  12 |             NESTED LOOPS OUTER           |                              |     1 |    69 |    15   (0)| 00:00:01 |
    |  13 |              NESTED LOOPS                |                              |     1 |    54 |    12   (0)| 00:00:01 |
    |  14 |               NESTED LOOPS               |                              |     1 |    38 |     4   (0)| 00:00:01 |
    |* 15 |                TABLE ACCESS FULL         | ZZZ_TEMP_NN                  |     1 |    26 |     2   (0)| 00:00:01 |
    |* 16 |                INDEX RANGE SCAN          | UNITRELFLAT_UI_UNITG_UNITM   |     3 |   114 |     2   (0)| 00:00:01 |
    |* 17 |               TABLE ACCESS BY INDEX ROWID| UNITRELS                     |     1 |    16 |     8   (0)| 00:00:01 |
    |* 18 |                INDEX RANGE SCAN          | UNITRELS_I_UNITG             |    15 |       |     2   (0)| 00:00:01 |
    |* 19 |              TABLE ACCESS BY INDEX ROWID | PROTORGS                     |     1 |    15 |     3   (0)| 00:00:01 |
    |* 20 |               INDEX RANGE SCAN           | PROTORGS_UI_PROT_ORG_TIS_LOC |     1 |       |     2   (0)| 00:00:01 |
    |* 21 |             INDEX RANGE SCAN             | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 22 |            INDEX RANGE SCAN              | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 23 |           INDEX RANGE SCAN               | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 24 |          INDEX RANGE SCAN                | UNITS_UI_ID_TYPE             |     1 |    11 |     2   (0)| 00:00:01 |
    |* 25 |         TABLE ACCESS BY INDEX ROWID      | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 26 |          INDEX UNIQUE SCAN               | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    |* 27 |        TABLE ACCESS BY INDEX ROWID       | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 28 |         INDEX UNIQUE SCAN                | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    |* 29 |       TABLE ACCESS BY INDEX ROWID        | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 30 |        INDEX UNIQUE SCAN                 | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    |* 31 |      TABLE ACCESS BY INDEX ROWID         | KND_UNITS                    |     1 |     5 |     1   (0)| 00:00:01 |
    |* 32 |       INDEX UNIQUE SCAN                  | KND_UNITS_PK                 |     1 |       |     0   (0)| 00:00:01 |
    -------------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
      15 - filter("QID"=(-4))
      16 - access("ID"="R"."UNITG")
      17 - filter("R"."TYPE"=0)
      18 - access("R"."UNITM"="R"."UNITG")
      19 - filter("TRUST"(+)>=0)
      20 - access("R"."UNITM"="PROT"(+))
           filter(DECODE("ORG"(+),0,0,1)=1)
      21 - access("R"."UNITG"="UG"."ID")
      22 - access("R"."UNITM"="UM"."ID")
      23 - access("R"."UNITM"="UM"."ID")
      24 - access("R"."UNITG"="UG"."ID")
      25 - filter("KG"."TREE"=1)
      26 - access("UG"."TYPE"="KG"."ID")
      27 - filter("KM"."TREE"=0)
      28 - access("UM"."TYPE"="KM"."ID")
      29 - filter("KG"."TREE"=1)
      30 - access("UG"."TYPE"="KG"."ID")
      31 - filter("KM"."TREE"=1)
      32 - access("UM"."TYPE"="KM"."ID")
    
    
    molfrelflat, molfprot - are views.
    
    Molfrelflat:
    SELECT r.unitg as molfgrp, r.unitm as molfmbr, r.dist, r.spl
    FROM unitrelflat r, units ug, knd_units kg, units um, knd_units km
    WHERE r.unitg = ug.id and ug.type = kg.id and kg.tree = 1 and
          r.unitm = um.id and um.type = km.id and km.tree = 1
    
    Molfprot:
      SELECT r.unitg as molf, r.unitm as prot
    FROM unitrels r, units ug, knd_units kg, units um, knd_units km
    WHERE r.type = 0 and
      r.unitg = ug.id and ug.type = kg.id and kg.tree = 1 and
      r.unitm = um.id and um.type = km.id and km.tree = 0
    
     SELECT table_name,num_rows,last_analyzed
     FROM user_tables
     WHERE table_name in ('UNITRELS','UNITRELFLAT','KND_UNITS','UNITS');
    How to disassemble a query? Thanks in advance.

    Best regards, Pavel.

    Pavel E. says:
    Collect statistics with dbms_stats.gather_index_stats (user, 'UNITRELFLAT_UI_UNITG_UNITM')

    UNITS_UI_ID_TYPE index statistics also do not seem to be correct. You can collect statistics on all indexes used by the query and check if the response time is not better when you run the query after the collection of statistics.

    Published by: user503699 on August 18, 2010 17:04

  • Loading the default limits for each execution

    Hello

    My situation is like this:

    I spend my sequence using the sequential model. Usually, the sequence is executed, 'in the loop', which means that when once the sequential model is launched, we can test unit after unit until we want to put an end for some reason any. The sequence is load dynamically by the sequential model and download after executing the step to discharge option.

    In the sequence, we use limits. Default TS limits similar to below.

    All our limitations change during execution depending on what unit we test and on what stage is the unit.

    Problem:

    I thought that if the sequence is loaded dynamically, it is unloaded when executing the next time that the next unit will be tested the default values of the container limits will be charged (in response to being dynamically loaded and unloaded at the step which called the main sequence is executed). Unfortunately, it seems that when we realize continous test the test limits have not returned to the default value, as expected, but they are a superposition of the limits assigned by previous executions. Of course

    Issues related to the:

    1 are my expectations about the behavior of TS are correct?

    2. how to impose default deadline to be 'reset', the default value for each run of the sequence, not only the first execution of sequential model?

    MimiKLM wrote: I am worry the speed of loading, you talked about associated to your solution, but potential problems with memory. Let say, I called the main sequence of 1000 times without breaking execution. So instead of having one copy of the sequence called with wiped/reset all variables and properties I have 1000 copies in the memory. I would call it a waste to have 1000 copies only because I need to have the properties and variables deleted.

    The copy exists only during the execution of the sequence. Once the execution of the sequence is complete, the copy will be destroyed/released. At least as long your code modules do not hold their own reference to it somewhere (which generally do not do).

    If you call from the main sequence 1000 times in a loop, you must still do not have a runtime copy into memory at once. The difference is a new copy is created (and destroyed once that the sequence is made running) each time, rather than create a copy only once and reuse. There is a performance hit in this call of your sequence which is somewhat proportional to the size of your sequence, but unless your sequence is really huge, or test you execution is extremely fast, you probably won't see the difference.

    Hope this helps to clear things up,

    -Doug

  • Operator privileges does not

    I use TS2014 SP1 (32-bit) and I was wondering if anyone has come across the following:

    I have in my User Manager, an administrator and a user of the operator (operator user and group operator attached).  What I see is that when logged in as an operator, I still all administrator privileges. For example, I can always edit globals station and change users, including the definition of the password for the admin user.  The privilege of the operator is to EditStationGlobals (debug) is set to False, such as changing users (under Setup).

    I tried some actions:

    1 remove the user from the operator

    2. completely out of TestStand, not only close or disconnect

    3. restart TestStand, log in as administrator

    4. Add a new user operator assigned to the Group of operators

    5. Repeat step 2 & 3, but the login as operator

    6. always am able to modify globals users and station

    7. checked group privileges are set to do not allow the global station or user change

    8 tried this method on another installation and works as expected.  The operator cannot change the globals users or station.

    Short of a one-install/re-install, I don't know where else adventure.

    Thank you!

    Never mind... found out what that was interfering.

    Check user privileges has been set to False in the StationOptions/User Manager

  • complete execution while the background thread runs

    After the passage of TestStand 4.1 in 2012, I see an interesting problem.

    I start a MainSequence via the SinglePass execution entry point using the parallel model. In ProcessSetup (in the execution of N), I start a background thread that performs certain tasks for viewing. Then the model passes by "Initialize TestSockets" and starts my MainSequence (in year N + 1).

    While the MainSequence is running, run N hangs in ParallelModel.seq > Single Pass, step "Wait for TestSockets", as it should. Usually, when the MainSequence is over, puts an end to execution and execution N goes to the next step "Check to terminate" and some time later, it passes through ProcessCleanup - where I'd send my background thread notification to stop.

    It works as long as I do not start the background thread. But when this thread is running, the execution of N + 1 never leaves the MainSequence. I arrive at a breakpoint at the end of MainSequence, ahead, and then all executions are happily showing a green light and continue to operate on. So running N never leaves "Waiting for TestSockets" and never reaches ProcessCleanup, so my son does not receive the signal of endpoint etc.

    But I distinctly remember that it worked in TestStand 4.1, and anyway, I don't understand this. Why, a background, started in the execution of N, thread prevents the execution of N + 1 to terminate?

    Concerning

    Peter

    "When execution starts a sequence in a new thread (not waiting for the thread to finish at the end of the sequence), should take care at the end of his MainSequence wire in order to put an end to herself in order for execution to terminate?"

    What do you mean by terminate? Process templates are not normally completed executions. Do you mean, "all discussions in an execution must complete before the end of the execution?"? If so, then the answer is Yes.

    I'm not completely your explanations above. I'm not sure what you mean by signs, but I think you're misunderstanding what terminate means in TestStand. Termination occurs only when a user explicitly requests a run to finish (e.g. finish all) or your sequence has an action to complete or by program initiates a terminate. Without endpoint explicit that past, executions normally end when all threads are finished executing. If you are spawning runs and new threads, you must come up with a mechanism to let them know when they have to leave. I do NOT recommend relying on or using termination for this. Termination is as abandoned (but with a cleaning), it is not intended to be something that happens in the normal flow of execution. There are several ways to tell your worker when all discussions. Perhaps this posting you are referring to is a way. You can also use a notification teststand step, or a Boolean value in reference parameter.

    Hope this helps to clear things up,

    -Doug

Maybe you are looking for

  • iCloud schedule sync on iPhone

    I noticed that my iCloud calendar stopped syncing on the iPhone 6. So what I've done so far: restart of the iPhone - no success double checked that if iCloud account is correct - it is Check if other services are working - contacts sync OK, e-mail sy

  • iWork - not good for businesses

    I'm a big fan of Apple, but the latest version of iWork is not functional for a company.  Many base/features features have been removed!  Why?  Do not level things down.  Please update if and bring back functionality of iWork ' 09, like fusion AND MA

  • Average arithmetic of the selected data region

    Hello there I need help visual c# .net: I want to know the average arithmetic mean of the values of foot between two points of the selected user. I think that the selection of points will be easy with cursor, when the user clicks about data, the curs

  • OE6, XP works great except that the content of the file is missing on the screen, can only access using the 'next '.

    Can send & receive OK but if I click on any folder, IE, Inbox etc, I just see the first message that is completely open and displayed, not the list of messages for me to select a. It goes the same for files sent/deleted. To see others, the only way i

  • HP Elitedesk 705 LTS G1: pcie intel 6205

    After installing an Intel 6205 802.11 PCIe Wireless card in an HP Elitedesk 705 G1 SFF PC, the pc does not start upward.   It gets to the Windows startup screen and restart again.    This will be repeated this constantly until the power is off.   The