no difference in performance on the sequence of release compared to insert third

Hello
I am perhaps concerned about how to proceed,

but y at - it overhead by using a trigger to store the unique value for a column of a sequence.
the other option is to use the seq.netval in the insert or merge statement.

It's a few million records per day.
Since I have an Oracle RAC cluster on 9i, I guess I must have noordered for reasonable performance.

To quote it's a batch of loading the several tables with unique value on several tables using insert and merge.

Thank you
Goo

Yes, there is a difference. With the help of a trigger will be significantly slower that put the sequence.nextval in your INSERT statement (assuming you have no other reason to have a trigger) because you'll avoid SQL 1 million to changes in context of PL/SQL. It would probably be a substantial fraction of the cost of him actually insert the data. Of course, if your insert statement performance is dominated by the cost of select the million lines, the impact of the trigger would be proportionately less.

As an illustration, a quick test on my machine indicates a difference factor 7. I can insert 1 million rows in 6.63 seconds

SQL> create table foo( col1 number );

Table created.

SQL> create sequence foo_seq cache 10000;

Sequence created.

SQL> set timing on;
SQL> insert into foo
  2  select foo_seq.nextval
  3    from dual
  4   connect by level <= 1000000;

1000000 rows created.

Elapsed: 00:00:06.63

But if I add a trigger, it takes 47,63 seconds

SQL> create trigger foo_trg
  2    before insert on foo
  3    for each row
  4  begin
  5    :new.col1 := foo_seq.nextval;
  6  end;
  7  /

Trigger created.

Elapsed: 00:00:00.70
SQL> truncate table foo;

Table truncated.

Elapsed: 00:00:01.35
SQL> insert into foo
  2    select 1
  3      from dual
  4    connect by level <= 1000000;

1000000 rows created.

Elapsed: 00:00:47.63

47,63 / 6.63 is slightly less than 7.2

Justin

Published by: Justin Cave on October 6, 2009 18:21

Tags: Database

Similar Questions

  • new hard drive - what is the difference in performance between the new installation of Windows 7 or a clone of old hard drive?

    I get a new hard Hard Drive (SSD).  The new disc is the same size as my existing SATA drive.  I can do either a new

    the installation of Windows 7 or a clone old hard drive?  I would prefer to clone the old hard drive and keep all my settings, etc.   It's empirical data on the performance difference between a new installation of Windows 7 or to continue with the Windows 7 which was 3 or 4 years ago.

    I know the conventional wisdom is that the new installation is faster, but, no matter who actually tested and compared the differences?  I know I'll get better performance of the SSD the SATA drive, but I don't know if it's worth the hassle to do a fresh install and redo all my programs and settings.

    Others that the performance of the SSD you should not see any differences.  If you do, you can always do a clean installation later.

  • Need to fill the value of the sequence in a field after insertion in the ofa page

    Hi all

    I have a custom OAF insert the page in do I have to fill out a sequence to a field value, once the data inserted with success at the table.

    so for this I followed the approach below.

    1 > created a database sequence.

    2 > java in the EOImpl of the file in the accessor method Set for their respective fields wrote code below.

    {} public void setContainid (numeric value)

    If (value == null) {}

    OADBTransaction t = getOADBTransaction();

    value = t.getSequenceValue ("XXXXX_CONTAIN_SEQ");

    }

    setAttributeInternal (CONTAINID, value);

    }

    But still, I'm not able to complete the sequence value for the field in my oaf page, please help me with that.

    Thank you

    Hello

    Write this logic to create the EOImpl method:

    public void create (AttributeList attributeList)

    {

    Super.Create (AttributeList);

    Transaction OADBTransaction = getOADBTransaction();

    ContID number = transaction.getSequenceValue ("XXXXX_CONTAIN_SEQ");

    setContainId (contID);

    }

    Sushant-

  • Difference in performance between the CTA and INSERT / * + APPEND * / IN

    Hi all

    I have a question about the ETG and "Insert / * + Append * / Into" statements.

    Suite deal, I have a question that I did not understand the difference in operating times EXADATA.

    The two tables of selection (g02_f01 and g02_f02) have not any partition. But I could partition tables with the method of partition by column "ip_id" hash and I tried to run the same query with partition tables. Change anything in execution times.

    I executed plan gather statistics for all tables. The two paintings were 13.176.888 records. The two arrays have same "ip_id' unique columns. I want to combine these tables into a single table.

    First request:

    Insert / * + append parallel (a, 16) * / in dg.tiz_irdm_g02_cc one

    (ip_id, process_date,...)

    Select / * + parallel (a, 16) parallel (16B) * / *.

    tgarstg.tst_irdm_g02_f01 a.,

    tgarstg.tst_irdm_g02_f02 b

    where a.ip_id = b.ip_id


    Elapsed = > 45: 00 minutes


    Second request:

    create table dg.tiz_irdm_g02_cc nologging parallel 16 compress for than query

    Select / * + parallel (a, 16) (b, 16) parallel * / *.

    tgarstg.tst_irdm_g02_f01 a.,

    tgarstg.tst_irdm_g02_f02 b

    where a.ip_id = b.ip_id

    Elapsed = > 04:00 minutes


    Execution plans are:


    1. Enter the statement execution Plan:

    Hash value of plan: 3814019933

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

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

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

    |   0 | INSERT STATEMENT.                  |    13 M |    36G |       |   127K (1) | 00:00:05 |        |      |            |

    |   1.  LOAD SELECT ACE | TIZ_IRDM_G02_CC |       |       |       |            |          |        |      |            |

    |   2.   COORDINATOR OF PX |                  |       |       |       |            |          |        |      |            |

    |   5:    PX SEND QC (RANDOM). : TQ10002 |    13 M |    36G |       |   127K (1) | 00:00:05 |  Q1, 02 | P > S | QC (RAND) |

    |*  4 |     IN THE BUFFER HASH JOIN |                  |    13 M |    36G |   921 M |   127K (1) | 00:00:05 |  Q1, 02 | SVCP |            |

    |   3:      RECEIVE PX |                  |    13 M |    14G |       |  5732 (5) | 00:00:01 |  Q1, 02 | SVCP |            |

    |   6.       PX SEND HASH | : TQ10000 |    13 M |    14G |       |  5732 (5) | 00:00:01 |  Q1 00 | P > P | HASH |

    |   7.        ITERATOR BLOCK PX |                  |    13 M |    14G |       |  5732 (5) | 00:00:01 |  Q1 00 | ISSUE |            |

    |   8.         STORE TABLE FULL ACCESS | TST_IRDM_G02_F02 |    13 M |    14G |       |  5732 (5) | 00:00:01 |  Q1 00 | SVCP |            |

    |   9.      RECEIVE PX |                  |    13 M |    21G |       | 18353 (3) | 00:00:01 |  Q1, 02 | SVCP |            |

    |  10.       PX SEND HASH | : TQ10001 |    13 M |    21G |       | 18353 (3) | 00:00:01 |  Q1, 01 | P > P | HASH |

    |  11.        ITERATOR BLOCK PX |                  |    13 M |    21G |       | 18353 (3) | 00:00:01 |  Q1, 01 | ISSUE |            |

    |  12.         STORE TABLE FULL ACCESS | TST_IRDM_G02_F01 |    13 M |    21G |       | 18353 (3) | 00:00:01 |  Q1, 01 | SVCP |            |

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

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

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

    4 - access("AIRDM_G02_F01".") IP_ID '= 'AIRDM_G02_F02'.' IP_ID")

    2 - DEC execution Plan:

    Hash value of plan: 3613570869

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

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

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

    |   0 | CREATE TABLE STATEMENT.                  |    13 M |    36G |       |   397K (1) | 00:00:14 |        |      |            |

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

    |   2.   PX SEND QC (RANDOM). : TQ10002 |    13 M |    36G |       |   255K (1) | 00:00:09 |  Q1, 02 | P > S | QC (RAND) |

    |   3.    LOAD SELECT ACE | TIZ_IRDM_G02_CC |       |       |       |            |          |  Q1, 02 | SVCP |            |

    |*  4 |     HASH JOIN |                  |    13 M |    36G |  1842M |   255K (1) | 00:00:09 |  Q1, 02 | SVCP |            |

    |   5.      RECEIVE PX |                  |    13 M |    14G |       | 11465 (5) | 00:00:01 |  Q1, 02 | SVCP |            |

    |   6.       PX SEND HASH | : TQ10000 |    13 M |    14G |       | 11465 (5) | 00:00:01 |  Q1 00 | P > P | HASH |

    |   7.        ITERATOR BLOCK PX |                  |    13 M |    14G |       | 11465 (5) | 00:00:01 |  Q1 00 | ISSUE |            |

    |   8.         STORE TABLE FULL ACCESS | TST_IRDM_G02_F02 |    13 M |    14G |       | 11465 (5) | 00:00:01 |  Q1 00 | SVCP |            |

    |   9.      RECEIVE PX |                  |    13 M |    21G |       | 36706 (3) | 00:00:02 |  Q1, 02 | SVCP |            |

    |  10.       PX SEND HASH | : TQ10001 |    13 M |    21G |       | 36706 (3) | 00:00:02 |  Q1, 01 | P > P | HASH |

    |  11.        ITERATOR BLOCK PX |                  |    13 M |    21G |       | 36706 (3) | 00:00:02 |  Q1, 01 | ISSUE |            |

    |  12.         STORE TABLE FULL ACCESS | TST_IRDM_G02_F01 |    13 M |    21G |       | 36706 (3) | 00:00:02 |  Q1, 01 | SVCP |            |

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

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

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

    4 - access("AIRDM_G02_F01".") IP_ID '= 'AIRDM_G02_F02'.' IP_ID")

    Oracle version:

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

    PL/SQL Release 11.2.0.4.0 - Production

    CORE Production 11.2.0.4.0

    AMT for Linux: Version 11.2.0.4.0 - Production

    NLSRTL Version 11.2.0.4.0 - Production

    Notice how this additional distribution has disappeared from the non-partitioned table.

    I think that with the partitioned table that oracle has tried to balance the number of slaves against the number of scores he expected to use and decided to distribute the data to get a 'fair sharing' workload, but had not authorized for the side effects of the buffer hash join which was to appear and extra messaging for distribution.

    You could try the indicator pq_distribute() for the insert to tell Oracle that he should not disrtibute like that. for example, based on your original code:

    Insert / * + append pq_distribute parallel (a, 16) (a zero) * / in dg.tiz_irdm_g02_cc one...

    This can give you the performance you want with the partitioned table, but check what it does to the space allocation that it can introduce a large number (16) of extensions by segment that are not completely filled and therefore be rather waste of space.

    Concerning

    Jonathan Lewis

  • The size of a difference in performance between the two different graphics cards

    Hey, I'm in the middle of upgrading my system and I try to spend my tax return on0 graphics cards. I'll run an SLI with Nvidia GTX 660 or 680 GTX. Now I realize the 680 is high the hand better than 660 I want to know is, it is better to the difference in price proformance wise. I intend to get two of them and SLI them, here are the two that I'm looking

    http://www.newegg.com/Product/Product.aspx?Item=N82E16814127699 - GTX 660

    http://www.newegg.com/Product/Product.aspx?Item=N82E16814127723 - GTX 680

    I'm running CS6 if I want to stay in the 600 series of Nvidia cards that are on the whitelist for CS6. I want to choose between these two cards because I'm under eyefinity right now and I can't go back, these Nvidia Surround support out of the box with any necessary adapters. MSI heatsinks are also fantastic with these cards.

    So basically what I'm asking, is the proformance go with 2 of the 680 years is worth the $500 price difference?

    Here is my system in its present form:

    Processor: AMD Phenom II X 6 3.2 GHz-> go to AMD 9590 x 8 5 GHz after I buy graphics cards

    RAM 16 GB Corsair Dominator 8-8-8-20

    Samsung 840 EVO 250 GB SSD (drive)

    Corsair 64 GB SSD as a scratch disk

    2 TB WD Black HDD as mass storage

    AMD Radion 6790-> will upgrading to one of the above cards

    Windows 8.1

    For After Effects, there is no reason to spend the extra money, unless you use a specific feature: the 3D rendering engine traced to the RADIUS. If you do not use this feature, and your focus is After Effects, then spend your extra money on RAM and SSD.

    See this page for more information about how After Effects uses the GPU:

    http://blogs.Adobe.com/AfterEffects/2012/05/GPU-CUDA-OpenGL-features-in-after-effects-CS6. HTML

    See this page for more information on material for Premiere Pro and Adobe After Effects: http://adobe.ly/pRYOuk

  • Is there a difference in performance between Automation Plug-ins and script system?

    We currently have a tool that, through the system of script, merges the layers by mask layer groups, exports and then moves to the next group of layers.  There is a custom logic and channel fusion that sometimes occurs in the fusion of a group of individual layers.  These operations occurred in the scripting system (in fact, c# through make calls of direct function through Photoshop), and there are pictures where these operations take about 30-40 minutes to complete on very large images.

    Is there a difference in performance between the actions in this way rather than having these actions occur in an Automation plug-in do?

    Thank you

    Using the DOM or the ActionDescriptor, ActionList, ActionReference API? There is a significant slow down using the DOM when looping through the layers. I have that as something to improve, but for a document with large layers, I would recommend trying to get the layer + layer 100 + value County via ActionDescriptor and loop them in this way. It is however a lot of work! I hope I can improve quickly and you won't have to deal with the drafting of a workaround.

  • With the help of the sequence

    Hello world

    Is it possible that we can assign/join a sequence on the column of a table, in fact, the requirement is that I table, in which a third person is going to be inserting data and they want join column where this sequence is expected to generate an automatic numbering after inserting each record a sequence.

    For as far as I know we can use the sequence through a form to insert the auto numbers.


    Any help will be appreciated.

    Thanks in advance
    Ahon

    Impossible to publish an UPDATE in the trigger, just assign the value to: NEW. COLUMN_NAME

    create or replace trigger samaibseq
    after insert on inboxsms
    for each row
    declare
    begin
      select samaib.nextval
        into :NEW.sno
        from dual;
    end;
    
  • What is the difference between the sequence #, # and # total in LR to images?

    Hello

    For custom to name what is the difference between the sequence #, # and # total in LR to images?

    Thank you

    Jason

    Read this article.

  • Is there a difference first and after the Performance of the effects in terms of CPU intel or AMD?

    Is there a difference first and after the Performance of the effects in terms of CPU intel or AMD?  Forget about the speed issue, assume that the processors are of comparable speed and also assume that the system is built beyond recommended configuration.  When it comes to reliablility and performance of each processor, work and managing data with CS5 is there a difference?  I am looking to build a computer with several CPU i7 so if outside as well (unless you can convince me that don't have a single processor is better than building with multiple) thanks for reading and I look forward to any help you can give me!  Bow.

    The test of disk i/o is 59; 58; 00, the MPEG2-DVD test is 2; 36; 04 and H.264 test - BR is 52 00

    What does it mean in real life? Hard to say how to look your timelines of real life and how leading practice comparisons, but I think that the H.264 timeline is much more demanding that 95% of users would meet. If you have CS5, you can download the ZIP file and take a look at all the effects and transitions used with alterations of Bezier curves in many and with all the different formats used in a single edit.

    There is one thing that you should keep in mind. The MPEG2-DVD H.264 - BR are directed to display the CPU/GPU performance and memory, but in real life, exporting to BRD involves also large (20 + GB) exports the disk, one of the things not measured in these two tests. This means that the high score of Juggernaugt in the H.264 test is only part of the story. We must also study the performance of disk i/o when exporting large files.

    My disappointing score on the H.264 test is caused by the lack of carrots, the memory and the cache limited on the 920. OTOH, price/performance wise I know that I prefer my setup the Juggenaugt.

  • Upgrade memory will make the difference in the performance of the laptop Toshiba NB?

    IT WILL MAKE A DIFFERENCE IN PERFORMANCE IF I MOVE NY LAPTOP 1 GB TO 2 GB?

    Yes, it will be.

  • The difference between the project settings and the settings of the sequence?

    As the title says, I don't understand why we have to select project settings when you create a new project. If a project can contain different sequences severel with different parameters, is it really important what are the parameters of the project?

    When you create a new project, you are presented with a menu of

    the sequence (not the project settings), to choose settings.

    You can skip this step by pressing "Cancel", then import your media

    and create the type of sequence that best adapts to your images.

    A single project can contain any number of different sequence types.

  • context of the sequence

    Hi all

    Is there a difference in execution time to pass a value using in Labview (v/s) son calling the sequence context and then call the property set?

    kindly let me know.

    Hello Padugur,

    Search in this thread:

    Context and sequence settings

    Wire are normally and parameters are faster then by setting a value via a property node.

  • HP Elite 8540W workstation: boost the performance of the laptop

    Hello..

    I just bought the HP mobile workstation elite is a fast computer, but is limited in storage, it has only a 250 HARD drive, im, consider using a second HDD but since I don't want hangs in two new drives hard im planning to use the 250 as storage and buy a 500 hybrid HARD drive as drive main HARD (for the operating system) , I know that the hybrid is normally faster than the normal HARD drive, but since I whant to increase performance of the laptop that I would like to know what better configuration.

    -Primary hybrids, normal as storage device.

    -Normal as primary hybrid, as storage device.

    -Two hybrids (one of the options above preferred since I just want to buy 1, but I'm open to buy two if the options above won´t help)

    What I put, t want to do is buy a single HARD drive and for a neck bucase bottel of the difference between the drives.

    I'll use the primariy for laptop design Solid works and games.

    Thanks in advance.

    Always run the operating system of the fastest device. Disks hard hybrids are only slightly faster than the readers of meachanical despite claims from marketing to the contrary, but choices you give I'd go hybrid as primary and normal as a storage device. If the budget allows, download a player in real solid state without mechanical transmission components.

  • Change the folder of default reports from outside the sequence editor

    Hello

    I want to set the path to the folder of the regular reports of TS (xml) outside the sequence editor, i.e. in a txt file. I would like to load this value in the sequence or the performance of model sequential (to read this file). Play with what I achieved only copy reports to different my folder both outside. No one knows how to correctly do this operation?

    See you soon,.

    K

    I have accomplished this setting the path of the report dynamically, using the ReportOptions reminder in my process model.

    I had set the following report options:

    Parameters.ReportOptions.DirectoryType = "SpecificDirectory".

    Parameters.ReportOptions.Directory = 'C:\\Program Files\\Functional Test\\Reports\\' + Parameters.UUT_PN

    Parameters.ReportOptions.BaseName = 'report '.

    Parameters.ReportOptions.UseFormatForExtension = TRUE

    Parameters.ReportOptions.Extension = «»

    Parameters.ReportOptions.ReportFilePath = «»

    Parameters.ReportOptions.NewFileNameForEachUUT = TRUE

    Parameters.ReportOptions.AddTimeAndDateToFileName = TRUE

    Parameters.ReportOptions.GeneratePath = TRUE

    arameters. ReportOptions.Format = "html".

    The second entry above, I set the directory based on the number of game USE which is analyzed by the operator.  So in your case, you will need to set the "Parameters.ReportOptions.Directory" item based on a path read you a text file.   According to the structure of your text, file, get the path of the report (from file) could be done in a few differnet ways...

    Thank you

    Paul Holzrichter

  • Run the sequence TestStand silently in c# with report

    Hello

    I use TestStand 2012 SP1 and Visual Studio 2010.

    I want to run a TestStand sequence silently in my c# software.

    I saw on this web site, how to run a TestStand sequence (https://decibel.ni.com/content/docs/DOC-29585).

    This example is really interresting to know how make it work using the .NET interop API.

    The problem that I can't solve is that no report is created during execution of the sequence, although I added a step to configure the ReportOptions.

    Here, you will find the class that I use to start the TestStand sequence:

    public execution StartSequence (string sequenceFilename, string resultDir, out SequenceFile seqFile)
    {
    Run exec = null;

    Try
    {
    The admin user = Engine.GetUser ("administrator");
    Engine.CurrentUser = admin;

    SequenceFile seqFileModel = null;
    StationOptions stationOptions = Engine.StationOptions;
    stationOptions.DisableResults = false;
    stationOptions.AllowOtherModels = true;

    int flags = 107; GetSeqFileOptions.GetSeqFile_OperatorInterfaceFlags;
    seqFile = Engine.GetSequenceFileEx (sequenceFilename, flags, TypeConflictHandlerTypes.ConflictHandler_Prompt);

    bool modelExists;
    String modelPath = seqFile.GetModelAbsolutePath (on modelExists);
    seqFileModel = Engine.GetSequenceFileEx (modelPath, GetSeqFileOptions.GetSeqFile_NoOptions, TypeConflictHandlerTypes.ConflictHandler_Prompt);

    Configure the report options
    int reportOptionCallbackIndex = seqFile.GetSequenceIndex (DefaultModelCallbacks.DefModCback_ReportOptions);
    If (reportOptionCallbackIndex > - 1).
    {
    seqFile.DeleteSequence (reportOptionCallbackIndex);
    }
    Sequence reportGenCallback = seqFile.CreateCallbackOverrideSequence (DefaultModelCallbacks.DefModCback_ReportOptions, false);
    InsertStatementStep (reportGenCallback,
    'Parameters.ReportOptions.DisableReportGeneration=False,\n ' +.
    'Parameters.ReportOptions.GeneratePath=False,\n ' +.
    Required string. Format ("Parameters.ReportOptions.ReportFilePath=\" {0} \",\n', GenerateReportFilename (resultDir, sequenceFilename)) +.
    'Parameters.ReportOptions.UseOnTheFlyReporting=True,\n ' +.
    "Parameters.ReportOptions.PurgeOnTheFlyResults = True");

    exec = Engine.NewExecution (seqFile, "Single Pass", seqFileModel, false, 0, null, null, null);
    exec. Report.Location = resultDir;
    }
    catch (Exception)
    {
    throw;
    }

    return exec;
    }

    What's wrong with my code and what should I do to obtain a report related to the only passes?

    I hope someone will help me

    Best regards

    CFOE

    Hello

    This code works very well I just forgot to manage performance by querying messages.

    Best regards

    CFOE

Maybe you are looking for