Parallel Execution  against Normal Execution

Hi,
Can someone explain why in this case Serial Execution is faster although enabling parallel dml at session level , What are the possibilities to improve speed of executoin for parallel execution as i need to populate for 139 stores data having around half a million rows for each store , i will have to run a cursor on the distinct value of store to achieve this , just to test i got the following Results , can anyoe guide where i am going Wrong?
This is the Script
set timing on
insert into r8_win_store
select * from win_store@rms8 where store=99;
commit;
alter session enable parallel dml;
insert /*+ Parallel(t,8) */ into r8_win_store t
select /*+ parallel(e,8)*/ * from win_store@rms8 e where e.store=99;
commit;
alter session disable parallel dml;
OUtput
SQL> @test1.sql
299666 rows created.
Elapsed: 00:03:48.12
Commit complete.
Elapsed: 00:00:00.01
Session altered.
Elapsed: 00:00:00.00
299666 rows created.
Elapsed: 00:08:02.81
Commit complete.
Elapsed: 00:00:01.31
Session altered.
Elapsed: 00:00:00.00

Parallel processing in Oracle is intended to reduce I/O latency. When you tell the kernel to do an I/O, you need to wait for that call to complete - disk platters to spin, disk controller heads to move, etc.
If you need to make a bunch of I/O calls after one another, you will spend up to 90% of the elapsed time waiting for that I/O to actually put the data into your buffer to process.
Now imagine doing a million I/Os.. and 90% of the time spend waiting for I/O to complete. A big performance knock and a frustrating one - as you cannot make that actual I/O any faster. It is simply slow. The slowest operation you can do on the computer and you're doing a million of them.
Parallel processing in Oracle addresses this problem. There can be sufficient I/O bandwidth to make a 100 I/O calls per second. But your process that does an I/O call, wait, process, and does an I/O call, wait, process, can only reach a speed of 10 I/O calls per second.
Which means 90% of the I/O pipe is free to do I/O in parallel. So instead of a single process doing that million I/Os (using 10% I/O bandwidth/thruput), Oracle spawns 10 process each doing a 100K I/Os each - thus making better use of the I/O thruput.
So Oracle PQ is useless if you scan small volumes of data - it is intended for large volumes of data. There are overheads in PQ as the parallel processes have to be coordinated in order to work together. When each only needs to do 10 I/Os, the time spend on coordination alone can be more than what the time would have been to simply do a 100 I/Os using a single process.
It is also a fallacy that number of CPUs determine the just how many parallel processes you can start. The real determining factor is the load you can put on your I/O subsystem.
Bottom line is that PQ is nothing "special" or "magic". It is simply a method to reduce I/O latency by performing parallel I/O. And it is only sensible to use when the amount of I/O to be done warrants parallel processing.
Oh yeah - and the CBO is very capable in deciding when to use PQ and not. So rather than force PQ down the CBO's throat using the PARALLEL clause and hardcoding the degrees and instances, it should rather make those decisions (as informed decisions) itself. Which means using the PARALLEL clause on tables and not as SQL hints. The DBA can easily tune that by altering the PARALLEL clause if a table.. The DBA cannot by any means do the same thing when dealing with SQLs that insists on a specific number of PQ processes on a specific number of instances.

Similar Messages

  • SM21 log Lock triggered against multiple execution

    Hi All,
    Please refer to the log in SM21 XI.  I have checked SM12 , no locks displayed. Please advise on how to analyze this log further.
    04:10:26 sapxi_XP1_*  DIA PIAFUSER Lock triggered against multiple execution: ID: C*************************
    Regards
    Shiva

    Dear Shiva, dear Daniel,
    the technical background for introducing  this system log entry was to deal with parallel execution of one message. For details please refer to SAP Note 1147287.
    Best regards,
    Harald Keimer

  • Clear one time customer against normal vendor in F110

    Hi Gurus,
    I am trying to see if it is possible to clear one time customer against normal vendor in F110.
    Customer and vendor have been linked and clearing with customer/vendor have been ticked.
    Customer invoice of $100 and vendor invoice of $150 have been posted.
    In F110 proposal, the two entries appears as separate lines.  The customer invoice has a red icon and it says that debit balance is not possible for payment.
    What are the matching criteria for customer and vendor transactions in F110? 
    I suspect it is caused by different payment recipient. The customer transaction took the customer name as payment recipient (e.g. ABC Coy - 00000001 which we have seen often for one time customers/vendors) I entered during invoicing.  It's blank for the vendor transaction.
    Putting aside the reason why we are not using a normal customer, anybody has any ideas?
    Thanks.

    Hi,
    Do you able to find a solution for your requirement.
    My business need is also similar to your. If you have got a workaround,can you kindly share it.
    Regards,

  • Size of SQL query before execution and after execution

    hi all
    I need help on how can i find out the size of SQL query before execution and after execution in java
    The query can be any query select / insert / update
    Can anyone help me if any system tables help to find out the required size i mentioned
    Urgent help is required
    Thanking in advance

    I need the size in terms of bytes
    like the rquirement is stated as below
    select ................: 10 B , return 250 B
    so i need size before and after execution in terms of bytes

  • SQL to find queries with execution time, total execution time so far,

    Hello Sir,
    We are looking for a query to find queries taking more than 6 seconds to execute, no of its executions so far, average execution time, total execution time so far.Thanks in advance.
    -Mal

    Something like this.
    SELECT s.SID, s.serial#, t.sql_fulltext,t.sql_id,s.action FROM v$session s, v$sql t
        WHERE s.status = 'ACTIVE'
          AND s.sql_address = t.address
          AND s.sql_hash_value = t.hash_value
          AND s.last_call_et >6HTH
    -Anantha

  • BW Job Taking more time than normal execution time

    Hi,
    Customer is trying to extract data from R/3 with BW OCPA Extractor.
    Selections within Infopackage under tab Data Selection are
    0FISCPER = 010.2000
    ZVKORG = DE
    Then it is scheduled (Info Package), after this monitor button is selected for the scheduled date and time, which gathers information from R/3 system is taking approximately 2 hours which used to take normally minutes.
    This is pulling data from R/3 which is updating PSA, the concern is the time taken for pulling data from R/3 to BW.
    If any input is required please let me know and the earliest solution is appreciated.
    Thanks
    Vijay

    Hi Vijay,
    If you think the data transfer is the problem (i.e. extractor runs for a long time), try and locate the job on R/3 side using SM37 (user ALEREMOTE) or look in SM50 to see of extraction is still running.
    You can also test the extraction in R/3 using tcode RSA3 and use same selection-criteria.
    If this goes fast (as expected) the problem must be on BW side. Another thing you can do is check if a shortdump occurred in either R/3 or BW -> tcode ST22. This will often keep the traffic light on yellow.
    Hope this helps to solve your problem.
    Grtx,
    Marco

  • JVM Crashes with a VM state:not at safepoint (normal execution) error

    Hello.
    I have been battling with this error occasionally ocurring for months. There are many suggestions in various blogs and they all seem to think it's a JVM bug. I'm not so sure.
    I am running JBOSS 4.0.5 on SuSE Linux 10. JVM is Java HotSpot(TM) Server VM (1.5.0_21-b01 mixed mode). The code is a servlet-based non-J2EE expanded WAR file. When my app starts, it instantiates a static object called ProductCache. This object has an inner class that extends Thread called RefreshThread which runs continually, sleeping for 60 minutes and then refreshing a java.util.Map in ProductCache called cache. It does this by calling a synchronized method addItem in the parent (ProductCache).
    RefreshThread does this initial population of cache when it is instantiated and before start() is called by the instantiating class (ProductCache).
    When I occasionally get the aforementioned JVM crash, it is always when this RefreshThread wakes up for the first time (60 minutes after instantiation). I immediately restart the JBOSS instance again, and the crash doesnt't happen again - until I stop JBOSS and replace the WAR with a new version. Once I restart JBOSS, there is a risk I may get the crash again. If I do, restarting JBOSS fixes it again!
    I have tried stopping and starting JBOSS a second time immediately after updating the WAR file and this seems to mitigate the problem, but occasionally it still occurs. Restarting after the crash always stops the problem happening again even in this case.
    Is there something about multithreading I am doing wrong? Are there special rules about instantiating threads from static objects? What about calling synchronized methods from threads instantiated by the object containing the synchronized method? Why would a restart after the crash always fix it?
    Linux Info:
    OS:SUSE Linux Enterprise Server 10 (i586)
    VERSION = 10
    uname:Linux 2.6.16.21-0.8-bigsmp #1 SMP Mon Jul 3 18:25:39 UTC 2006 i686
    libc:glibc 2.4 NPTL 2.4
    rlimit: STACK 8192k, CORE 0k, NPROC 71680, NOFILE 1024, AS infinity
    load average:0.12 0.07 0.01
    CPU:total 4 (cores per cpu 2, threads per core 1) family 6 model 15 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2
    Memory: 4k page, physical 8308300k(1178612k free), swap 2561k(2561k free)JVM command:
    jvm_args: -Dprogram.name=run.sh -Xms512m -Xmx2048m -XX:-UseOnStackReplacement -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true -Duser.timezone=Pacific/Auckland -Djava.endorsed.dirs=/home/jboss/jboss-live-nz/lib/endorsed
    java_command: org.jboss.Main -b webapp1-2 -c default -Dlog4j.configuration=file:///home/jboss/jboss-live-nz/bin/log4j.properties
    Launcher Type: SUN_STANDARDRefreshThread code (partial):
         private class RefreshThread extends Thread implements RecordListener {
              private boolean die = false;
              private ProductCache parent;
              private DAOFactory factory;
              private CacheProductManager productManager;
              private AssortmentCache assortmentCache;
              private Map products;
              private RefreshThread( ProductCache caller ) throws Exception {
                  this.setName( "CellnetProductCacheRefresh" );
                  parent = caller;
                        factory = DAOFactory.getInstance( context );
                        productManager = (CacheProductManager)factory.createProductCacheLoader();
                        assortmentCache = AssortmentCache.getInstance( context );
                  loadFromDatabase( true );
                  loadV6Data();
              public void stopRefresh() {
                   this.interrupt();
              public void run() {
                   while( ! die ) {
                        try {
                             Thread.sleep( AppProperties.CACHE_PRODUCT_REFRESH_RATE * 60 * 1000 );
                             products = new HashMap();
                             productManager.loadAllItemsFromDatabase( this );
                             GregorianCalendar now = new GregorianCalendar();
                             if ( now.get( GregorianCalendar.HOUR_OF_DAY ) == 23 ) {
                                 update( true, products );
                             } else
                                 update( false, products );
                        } catch (CellnetWebException cwe) {
                            cwe.printStackTrace();
                        } catch (InterruptedException ie) {
                            die = true;
                        } catch (Exception e) {
                            e.printStackTrace();
             private void update( boolean fullReload, Map products ) throws Exception {
                   int addedCount = 0;
                   for( Iterator iter = products.keySet().iterator(); iter.hasNext(); ) {
                       ProductBean product = (ProductBean)products.get( iter.next() );
                       if ( fullReload || (! cache.containsKey( product.getId()) ) ) {
                           parent.setItem( product, null );
                           ++addedCount;
                           if ( ! fullReload ) {
                               try {
                                 List productAssortments = productManager.findAssortments( product.getId() );
                                 for( Iterator listIter = productAssortments.iterator(); listIter.hasNext(); ) {
                                     String assortmentId = (String)listIter.next();
                                     assortmentCache.addItem( assortmentId, product.getId() );
                             } catch (Exception e) {}
                   if ( ! fullReload ) {
                       int deletedCount = 0;
                        for( Iterator iter = cache.keySet().iterator(); iter.hasNext(); ) {
                            String id = (String)iter.next();
                            if ( ! products.containsKey( id ) ) {
                                iter.remove();
                                ++deletedCount;
                                assortmentCache.removeItem( id );
                   if ( fullReload ) {
                        assortmentCache.refresh();
             private void loadFromDatabase( boolean fullReload ) throws Exception {
                 if ( productManager == null ) {
                     DAOFactory factory = DAOFactory.getInstance( context );
                     productManager = (CacheProductManager)factory.createProductCacheLoader();
                 if ( fullReload ) {
                        System.out.println( "Full Product Cache upload commenced" );
                     cache = new HashMap();
                 products = new HashMap();
                   productManager.loadAllItemsFromDatabase( this );
                   System.out.println( products.size() + " Products Loaded from the Database" );
                   update( fullReload, products );
    ...

    What do you mean by JVM crash? A core dump? Your code, shouldn't be able to cause a core dump even if you had a bug in it.
    I did not read your code, and I don't know what you mean by static object, but you can start a thread from wherever you want, and where the thread was created doesn't matter. It should be able to invoke any methods. The only things that you have to think about is that you can get race conditions, deadlocks and all other issues that are related to concurrency.
    Kaj

  • Execution faster with execution highlighti​ng???

    This is wierd.  I noticed that the VI that performs serial communications with my power supply taking a long time (~15s).  I turned on execution highlighting and the execution time reduced (~10s).  I ran profiling with performance and memory and the total execution time is reported as only 250ms in normal mode but the front panel and block diagram are locked for 15s.
    Any ideas on this behavior?
    LV 8.5.1, WinXP

    kc64 wrote:
    Shane--
    Thanks for the replies.
    I added an AE logging function that I use to help debug the code.  When I added this, the timing came in line.  I don't know what the root cause is but I think I will move on until it breaks again.
    Thanks,
    Kevin
    Does that mean you no longer have a problem?  Did the problem go away?  Or upon closer inspection you realize you really didn't have a problem?  Or the AE logging function helped solve the problem for you?
    "but I think I will move on until it breaks again".  That is a troublesome thought.  It you really have a problem but haven't solved it, that means it will eventually break, and when it does, you will have that much more code on top of it and make it that much harder to troubleshoot.
    If you really have a problem, it's better to find it and fix it now while the code is still relatively simple.  Building on a bad foundation is just going to cause the whole house to come crashing down later.

  • Foreground Execution Vs. Background Execution

    Hi all,
    I've a program, when executed in the foreground, it's taking few seconds for the output to be displayed. But, when i execute in the background, it's taking longer time.
    My question is what might be the reason for such difference in execution times?
    Regards,
    Pavan

    Hi pavan,
    1. JOB Class
    2. By default the Job class =  C
    3. So, put this as A
    <b>A - High priority</b>
    B-  Middle priority
    C - Low priority
    regards,
    amit m.

  • Regular execution OK, OTA execution NOT. for IM application.

    I'm trying to build a J2ME instant messaging app using netbeans6.0. managed to build the source which ran well in the emulator BUT NOT RUNNING at all when trying to download and install to my cellphone (nokia 6235) "invalid application".
    then I tried running it with OTA execution but the build process was unsuccessful. below is the error I get:
    ++Running in the identified_third_party security domain++
    ++** Error installing suite (16): Reason = 16++
    ++Execution completed.++
    ++3461764 bytecodes executed++
    ++59 thread switches++
    ++1665 classes in the system (including system classes)++
    ++17803 dynamic objects allocated (535908 bytes)++
    ++1 garbage collections (0 bytes collected)++
    ++Running with storage root C:\Users\Reno\j2mewtk\2.5.2\appdb\DefaultColorPhone++
    ++Running with locale: English_United States.1252++
    ++The storage name for the MIDlet suite was not given++
    ++Execution completed.++
    ++3329764 bytecodes executed++
    ++38 thread switches++
    ++1665 classes in the system (including system classes)++
    ++17144 dynamic objects allocated (507400 bytes)++
    ++1 garbage collections (0 bytes collected)++
    ++C:\Users\Reno\Documents\NetBeansProjects\bombus\nbproject\build-impl.xml:286: Execution failed with error code -1.++
    ++BUILD FAILED (total time: 35 seconds)++anyone's interested with the source code you can get it here: http://bombus.jrudevels.org/wiki/bombus/svn
    please help.
    Thx in advance

    anyone's interested with the source code you can get it here{color:#000080}Is this a joke? That page is in Russian! If it's not a joke, please provide a link that goes directly to your code.
    Are you using WMAPI (jsr-120/205)? They are optional APIs, first confirm availability on the handset.
    db{color}
    B&#1089;&#1077; &#1085;&#1077; &#1079;&#1085;&#1072;&#1102;&#1090; &#1088;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1103;&#1079;&#1099;&#1082;!

  • Diff between Processing and Execution

    Could you please Help Me??
    what is synchronous processing and Execution.

    hi
    synchronous processing is  that in which the progaram can not continue to execute until u get the response from it.
    execution is normal execution of the prgram which can be either synchronous and asynchronous.
    <b>example</b>
    data: oref type ref to CX_SY_DYN_CALL_ILLEGAL_FUNC,
          text type string  .
    try.
    CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
      EXPORTING
        tcode                   = 'SM59'"                  
    "transaction sm59  opens in same session
    EXCEPTIONS
        call_transaction_denied = 1
        tcode_invalid           = 2
        OTHERS                  = 3.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CASE sy-subrc.
      when 1.
        WRITE :/ 'call transaction denied'.
      WHEN 2.
        WRITE :/ ' transaction doesnot exist'.
    ENDCASE.
    catch CX_SY_DYN_CALL_ILLEGAL_FUNC  into oref.
    text = oref->get_text( ).
    endtry.
    WRITE / text.
    WRITE: / 'End Of Demo For Synchronous RFC'.
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • JDev 10.1.3.1 + Java 1.6 - GUI Problems

    Hi All,
    since adding Java 1.6 to my project libraries - the GUI developer has been acting strangely. In particular toolbars refuse to display any command buttons placed on them. But when I run the application, they buttons are all visible.
    If I add several buttons to the toolbar using the GUI developer, they are visible. If I then rebuild the form - the buttons vanish. If I run the application, the buttons are visible.
    Any ideas
    TIA
    Bill
    -

    After further analysis it appears that if I duplicate an existing JInternalFrame that doesn't display the command butttons on the toolbar (using the GUI designer) and just start removing code, eventually the buttons will be displayed. (the buttons are always correctly displayed during either debug execution or normal execution). If I then start putting code back, I can reach a 'toggle point' - remove a single class = buttons are displayed, add the class back = buttons 'disappear'. (There being no other references to the class being added/removed)
    I tried increasing the memory options - but that had no effect.
    So what next ? - the application is a MDI with 100+ JInternalFrames - (most of which have associated JTables + DB access). It's currently packaged as a single Jar.
    TIA
    Bill

  • How to see parallel execution servers

    Hi
    From a session I am running a query in parallel. Having the session's ID and serial number I want to identify the query coordinator process and the slave processes which run in parallel.
    Please, tell me from which views and how can I query this information?
    So far, I tried this:
    SELECT * FROM gv$px_session WHERE sid = <MY_PARALLEL_SESS_SID>;However it didn't returned any rows. I know the session's query is running in parallel because of the execution plan.
    My database version is 11.2.0.2 and my OS is Oracle Solaris 10 X86
    Thank you!

    Thank you for you reply!
    However, the reason I didn't see any rows was that another session had occupied all the parallel processes without releasing them.
    Once they were released, my session took them and I could see them in the views.
    Nevertheless, thank you for the link, I will definitely read it.

  • Conditional execution of main DataTemplate

    Hi All,
    I am working on a Report in BI Publisher where the Data Model consists of three data sets of type-data template which are as below:
    1) Before Trigger
    2) Main DataTemplate
    3) After Trigger
    Now, I need to conditionally execute the main DataTemplate, depending on the return value of a function called in "Before Trigger". So, when function returns true, "Main DataTemplate" code is to be included in execution, and when it returns false we need only the code in "After Trigger" to be executed.
    Please guide me in achieving the above.
    Thanks
    Actual Problem- Elaborated:-
    In a report, first we need to check if the table used in code exists. In case it does, actual report is to be generated, and in case the table does not exist an error message is to be displayed as pdf output.
    To achieve this we have a function in "Before Trigger" that returns true/false based on table's existence. Now we need to execute the report code depending on the outcome of this function.
    For value = true, normal execution of report is to take place
    For value = false, code of main datatemplate needs to be bypassed, and flow to "After Trigger" so as to avoid BI Publisher error "table or view does not exist".
    The display of report/customised error message as output can be handled at the rtf level using sub-templates and if-else statements.
    Please let me know in case you need some other details from my end.

    Hi,
    I am not sure what kind of "Conditional Execution" you are looking for.
    Syndication Server is based on the "Port" concept and we can associate an already saved Syndicator Map that also includes your Search criteria. So, the syndication server simply executes this map at a defined interval and places the file in the appropriate folder of the "Port". But, Syndication server cannot determine the map to be executed based on a condition and it also cannot determine search criteria within a map based on a condition.
    If your requirement is to execute a map based on a condition, I suggest you to use "Syndicator Batch" commands and use a program that triggers appropriate map based on this condition.
    Hope this helps,
    Regards,
    Rajani

  • Execution Time 1:35 minute

    Good morning everyone,
    We have several tables in DB and we are writing a query.
    Normally, execution time is 1 msec for most but A query took time 1:35 minute.
    The query return with 6 column that five is number, one is a string(10 words).
    If you have a chance, please help us usual.
    Thanks in advance,
    S!G
    Edited by: Sea!Gull on Sep 29, 2010 8:39 AM

    Hello,
    "Basically " , you can consider the use of a "lexical reference" as "text replacement" by Reports in the SQL query
    It means that Reports will replace the string &P_XXX by its values before submitting the SQL query to the DB
    Have you tried to do this "manually" and execute the result in SQL*Plus ?
    Regards

Maybe you are looking for

  • ITunes is not recognizing either of my iPhones any longer

    I was originally having trouble with the new iPhone 5 that I got for my wife.  iTunes would not regonize it at all, even though Windows recognizes that something is plugged into the USB port.  I reinstalled iTunes per the article that has you remove

  • Current.tdf in Home folder

    Since September of 2004 I've had what is labeled as a Unix executable file called Current.tdf in my Home (user) folder. I can't imagine what it might be. Is this file required for OS X, or can it be safely trashed? (It's only 4K in size.)

  • Uploading image path

    Hi All, in my requirement i need the  path where the image will be uploading in  the server dynamically. Thannks, Ramani.

  • Zen Touch - can't start recovery mode

    I have also been trying to fix my frozen Touch, and followed Bismarck's instructions carefully, but after loading the Firmware 2..0 my Touch now opens to a screen that says "Now Playing" "Add music from Library" "Press menu Button" Pressing Menu butt

  • How to add icc profiles to LR4

    I have viewed many videos and read much literature to no avail. Any ideas would be appreciated.