Generation of line faster way

Hello Experts

I need a script that fills my table with test data.

What are your views, this script could be solved?

CREATE TABLE TEST_TAB

(id_test NUMBER (10))

, x_domain VARCHAR2 (1)

, id_object NUMBER (10)

)

TABLESPACE ALL_DATA

/

id_test: this is the primary key. It should go from 1 to 10 000 000.

x_domain: it has 3 values and distribution should be the case:

M: 94% (M = hand)

(S): 4% (S = Sub)

O: 2% (O = other)

id_object: random number between 0 and 10 000 000

TERMOUT SET SERVEROUTPUT ON

DECLARE

v_start TIMESTAMP (6);

v_end TIMESTAMP (6);

BEGIN

RUN IMMEDIATELY 'TRUNCATE TABLE TEST_TAB;

v_start: = CURRENT_TIMESTAMP;

INSERT / * + APPEND PARALLEL (16) * /.

IN TEST_TAB (id_test, x_domain, id_object)

SELECT LEVEL AS ID_TEST

, CASE level WHEN < = 10000000/100 * 94 THEN'm '

"WHEN level > 10000000 / 100 * 94 AND level < = 10000000/100 * 98 THEN."

ELSE 'O'

END AS X_DOMAIN

TRUNC (dbms_random.value (0, 10000000)) AS ID_OBJECT

OF THE DOUBLE

CONNECT BY LEVEL < = 10000000

;

COMMIT;

v_end: = CURRENT_TIMESTAMP;

DBMS_OUTPUT. Put_line ('Insert is: ' |) To_char(v_end-v_start));

END;

/

SQL * more: Production of release 11.2.0.1.0 Thu Jan 16 11:21:43 2014

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:

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

With partitioning, OLAP, Data Mining and Real Application Testing options

Insert took: + 00:02:12.020934000 000000000

PL/SQL procedure successfully completed.

SQL >

I read of rp0428 first of all, he must use SQL and PL/SQL. But it seems to me that this sql took too long... Can be tuned?

Hello Randolf

Your solution is the best!

Your result is:

===========

SQL * more: Production of release 11.2.0.1.0 on Mon Jan 20 09:48:02 2014

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:

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

With partitioning, OLAP, Data Mining and Real Application Testing options

09:48:03 SQL >

09:48:03 SQL > alter session enable dml parallel;

Modified session.

Elapsed time: 00:00:00.00

09:48:03 SQL >

09:48:03 SQL > truncate table test_tab;

Table truncated.

Elapsed time: 00:00:00.15

09:48:03 SQL >

09:48:03 SQL > insert / * + append parallel (16) * /.

09:48:03 2 in (test_tab)

09:48:03 3 id_test, x_domain, id_object

09: 48:03 4)

09:48:03 5 with

09:48:03 6 generator1 as

09:48:03 () 7

09:48:03 8 select / * +.

09:48:03 9 cardinality (1e3)

09:48:03 10 materialize

09:48:03 11 * /.

09:48:03 12 rownum as id

09:48:03 13, rpad ('x', 100) as filler

09:48:03 14 from

09:48:03 15 double

09:48:03 16 connect by

09:48:03 level 17<=>

09: 48:03 18).

09:48:03 19 generator2 as

09:48:03 (20)

09:48:03 21 select / * +.

09:48:03 22 cardinality (1e4)

09:48:03 23 materialize

09:48:03 24 * /.

09:48:03 25 rownum as id

09:48:03 26, rpad ('x', 100) as filler

09:48:03 27 of

09:48:03 28 double

09:48:03 29 connect by

09:48:03 level 30<=>

09: 48:03 31)

09:48:03 32 select

09:48:03 33 id like id_test

09:48:03, 34 cases

09:48:03 35 when id<=>

09:48:03 36 then'm '

09:48:03 37 when id<=>

09:48:03 38 of then '

09:48:03 39 other 'o'

09:48:03 40 end as x_domain

09:48:03 41, trunc (dbms_random.value (0, 10000000)) as id_object

09:48:03 42)

09:48:03 43 select / * + leading(b a) * /.

09:48:03 44 (a.id - 1) * 1e4 + b.id as id

09:48:03 45 of

09:48:03 46 generator1 one

09:48:03 47 b, of generator2

09: 48:03 48)

09:48:03 49;

10000000 lines were created.

Total time: 00:00:10.64

09:48:13 SQL >

09:48:13 SQL > commit;

Validation complete.

Elapsed time: 00:00:00.08

09:48:14 SQL >

Thank you!

Tags: Database

Similar Questions

  • a faster way for PDM-to-Excel conversion?

    I connect my packets received using blocks PDM, since it is suggested that IO low is the fastest. Since I need data in formal Excel, after my experience, I run a small code that uses 'Reading file of measure' and 'Write in the file of the measure' blocks to convert TDMS to Excel.

    This conversion takes too long, for example 15 minutes from port of 1 million bits of PDM for Excel (I connect packets in their binary form, of 1 and 0). I have attached the VI conversion.

    I have 2 questions:

    1. does anyone know any faster way for the conversion of PDM in Excel?

    2. I need the block 'Reading files measure' in my conversion code since the packets received are saved in TDMS in the form of a single vector, and I need to convert this very long vector in a matrix where each line corresponds to a received packet. Is it possible to make connecting TDMS in the form of a matrix, instead of one vector? This can be slow down my code much.

    Thank you!

    Hi filipfilip,

    Have you considered using the TDM Excel add-in? You can then save the resulting Excel workbook and get the desired file format.

    More information can be found here:

    http://www.NI.com/white-paper/4906/en/

    There is a solution on this post on the forum too which can allow you to do this automatically. I don't know how much faster it would be than your current method but I think it would be interesting to give it a go.

    http://forums.NI.com/T5/LabVIEW/convert-import-TDMS-to-Excel/m-p/1088746

    I hope this helps, please let me know if you have any questions.

    Thank you

    Charlotte N.

  • I have more than 5000 messages in my windows mail inbox. Is there a faster way to remove several emails then hold down the ctrl key and click on individually on each e-mail?

    removal of several emails

    I have more than 5000 messages in my windows mail inbox.  Y at - it a faster way to delete several emails then hold the ctrl key and click on individually on each e-mail

    Yes.  Click on the email at the top of the page and highlight the bottom and shift, click.  Then delete the whole thing.

  • Is there a faster way to put an application on the device?

    Currently I use the Application Loader to put my test on the blackberry for testing application. I have to first remove the application, and then add it. It takes about 5 minutes. Is there a faster way?

    I tried to update, but the Manager don't think that the application has changed, although I have met with the updated code.

    [Please do not mention the Simulator in response, thank you.]

    See you soon.

    How about using javaloader?

  • Impossible to install Photoshop Lightroom 6.0, because my PC is not a 64 bit system. Tried to download Photoshop Lightroom 5.71 but the code provided for 6.0 cannot be used. Faster ways to solve this problem

    Impossible to install Photoshop Lightroom 6.0, because my PC is not a 64 bit system. Tried to download Photoshop Lightroom 5.71 but the code provided for 6.0 cannot be used. Faster ways to solve this problem?

    Lightroom 5.7.1 is the latest version that is compatible on 32-bit computers.

    LR 6 serial number will not work for LR 5.

    Lightroom version 5 S/N is the separate serial number.

    In this case, you will need to contact the Support from Adobe and to return the product if you do not buy 64-bit computer and see if you can buy 5 LR.

    Contact the customer service

    [Click on always need help (help), then select the Chat option]

  • Y at - it a faster way to remove folder

    Make up some automation scripts to create folders in the mass with associated cleanup scripts and I was wondering if someone came with a faster way to run... Similar to get - vm vs LucD-GET view?

    PowerCLI C:\temp > Measure-Command {Get-file-name 'Solutions Design 7' |} {Remove-file-confirm: $false}
    Days: 0
    Hours: 0
    Minutes: 0
    Seconds: 7
    Milliseconds: 414
    Ticks: 74143023
    TotalDays: 8.58136840277778E - 05
    TotalHours: 0.00205952841666667
    TotalMinutes: 0.123571705
    TotalSeconds: 7.4143023
    TotalMilliseconds: 7414.3023

    PowerCLI C:\temp > measure-command {Remove-file 'Solutions Design 6' - confirm: $false}

    Days: 0

    Hours: 0

    Minutes: 0

    Seconds: 7

    Milliseconds: 228

    Ticks: 72287489

    TotalDays: 8.36660752314815E - 05

    TotalHours: 0.00200798580555556

    TotalMinutes: 0.120479148333333

    TotalSeconds: 7.2287489

    TotalMilliseconds: 7228.7489

    Try this variation

    Get-View -ViewType Folder -Filter @{"Name"="^Solutions Design 7$"} | %{
      $_.Destroy_Task()
    }
    

    The filter uses the RegEx expression on the right operand, where the ^ and $ metacharacters.

  • Is there a faster way to add text repeated in addition to the hand tool?

    Every day I receive several documents to edit and to each, there is a page where I enter the date 3 times. The file come with me so I can't do the thing in javascript, others spoke. I just go to tools, add text (date) and then use the hand for copy/paste tool. However, since for some reason hand tool that she pours just in the middle of the screen and I have to drag it to the area I need, I found it faster just to keep clicking and typing in the date I need.

    Whenever I do this, I keep thinking, "there must be a better way." Are there?

    With the help of Adobe Acrobat Pro

    There is no shortcut for this.

    A faster way may be to click and paste instead of paste and drag.

    1. right click on the page, then select "add text".

    2. click on the place where you want to enter.

    3. Paste (Ctrl/Cmd + V)

  • A faster way to fix several bitmaps

    I want to know if there is a faster way to take several bitmap images and arrange them one after the other in a single layer in a clip.

    This is how I currently do.

    Step 1: Import the bitmaps to the scene

    Step 2: Distribute the bitmaps in layers

    Step 3: Make the first bitmap a MovieClip instance and cut frames other bitmaps

    Step 4: Go to the symbol, create a new layer and paste images.

    Step 5: Click and drag the other images in a single layer, one after the other.

    I now have a single clip with all my bitmaps ordered one after another in the timeline panel.  You could probably see how this can be a process very painful with bitmaps of 50 or 60 to do it.

    If your bitmaps are named in a sequence, you can import them into a timeline and flash will then distribute each in a sequential frame on the timeline.

    Otherwise, create a movieclip, import the entire scene, distribute to layers, and click on the 2nd to the frame in the top layer, then mousedown and drag to image 2, then click on the 3rd layer and mousedown drag image 3, etc.

  • Is there a faster way to do this?

    Say, I have 20 small mov I need to play one after the other. Is what I came with selecting them all in the project Panel and dragging it to a new computer downstairs, but that it does that it positioned at the same value of 0:0:0 the frame at the time and I have to spend some 10 to 20 minutes by dragging to the right to ensure that all play one after the other.

    Is there a faster way to position them in a model?

    Select all in the timeline panel and choose sequence/Assistants Animation layers / Animation.

  • Optical text table / Fast Way?

    Hi guys,.

    Is it possible to give a text of characters from all the optical table of separation in a fast way? Here is the image

    http://www.pixentral.com/show.php?picture=1ipky1nC6jJhEUuUktQ5XBiaNMQhM

    If I have this text highlight the view/settings option disappears. I could create a character Style, but it does not work if I have regular and italics in the text. I'm looking for a way to simply highlight and apply fast optical separation.

    Any idea?

    Thank you and Bravo,

    Sebastian

    Paragraph style; no character style. And then, also, you might make a cell style to call the paragraph style that calls the optical kerning values. You can make a table style that brings together the cell styles that calls for paragraph styles that calls the optical kerning values.

    It's all the paragraph style!

    Mike Witherell in Maryland

  • is there a faster way to install Excel add-in for Essbase 11.1.1.3?

    Hello
    Is there a faster way to install Excel add-in for Essbase 11.1.1.3?
    We have a lot of Essbase users and I do not install install Hyperion, followed by the installation of assemblies, the Services of the Foundation and, finally, Excel Add-in.
    (Here is another pain in the installation of several assemblies...
    Re: Microsoft Excel Add-in to the 11.1.1.1.x version )

    Usually the excel add-in has been backwards compatible, I have not tried all the features, but what I used seems to be ok.
    Although do not blame me if everything does not work :)

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Generation SQL line with connection by level

    Hello

    I'm looking for generate lines based on a quantity of part numbers.  I have looked all around several techniques for the generation of the line, but have failed to address this problem.  The current method, it seems pulls a permutation of all possible combinations, and the result is rising quickly to millions / billions of documents... which is not the answer.  Someone out there who could help writing a query to do this?

    What I try to achieve if a quantity of part 5, I want to display 5 Qty 1 documents.  If the Qty 12, then 12 Qty 1 documents.  So on and so forth.

    Out Oracle 10.2.0.4 operation

    Sample data:

    drop table test;

    create table test (part varchar2 (20), number of quantity);

    Insert test values ('WIDGET', 12);

    Insert test values ('FOO', 5);

    Insert test values ('THING', 3);

    Insert test values ("WAD", 8);

    commit;

    -This query does not work... I think it's getting all the possible permutations

    -Select a part, 1

    -to test

    -connect by level < = Qty

    -what I want to see...

    Part Qty.

    ------      ----

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    WIDGET 1

    FOO 1

    FOO 1

    FOO 1

    FOO 1

    FOO 1

    THING 1

    THING 1

    THING 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    BUNDLE 1

    Hello

    You want something like this:

    SELECT part

    Qty. 1

    OF the test

    CONNECT NOCYCLE LEVEL<=>

    AND an EARLIER part = part

    AND PRIOR SYS_GUID () IS NOT NULL

    ;

    You may have copied the request of something that just use the array of double.  When you have more than 1 row of the table, then you need by using the PRIOR operator in the CONNECT BY clause.

  • Is there a faster way to make a backup of a complete catalog of Lightroom and DNG?

    Hoping someone can help - sorry if I'm thick, I'm not very focused on techno!

    I work with Lightroom 3 on Mac OS X 10.5.8. Archive photos from the Mac hard drive to an external hard drive (related to the Mac via an airport) every few months, moving them in Lightroom to keep visible in the catalogue of my work, so I can continue to have access. The Mac is saved using Time machine every hour, and my automatic backup of the Lightroom Catalog is saved on the hard drive to the Mac, so being on Time machine backup automatically as well (is it wrong?).

    I want to save my pictures archived since the external hard drive on a second hard drive external, then kept off-site, in case of failure / fire etc., back to the time of the actual photos (DNG) and the adjustments in Lightroom etc.. So I need to update this backup hard drive whenever I have a new series of archive photos, the goal is to get a copy of the archive and get the back-up hard drive off the premises as soon as possible, to make sure that I always have a back up of all my photos archived once they are moved out of my Mac. So far I have done this by "export as a catalogue, with the negative files", on the second hard drive. However, as my archived catalog has now reached 14 000 photos, this last export as a catalogue took 2 days... Am I missing a (faster) easier way to do this, please? I'm not just a copy of the catalog, I need real pictures so backed up. Hope it makes sense.

    clvrmnky wrote:

    BTW, at one point that the tips were to Time Machine backup do not leave your catalog of files if Lr had opened. I'm sure that it is still a problem.  Always ensure that LR does not run during execution of TM or excuse the file catalog via the preferences of TM.  There is a slight risk of corrupting the catalogue otherwise.

    According to the help documents, when 3 Lr is open it marks itself as private and therefore excluded any Time Machine backups. Once the application is closed down it can be backed up by Time Machine.

    Related to the original question - use a specially designed backup as suggested by clvrmnky application. Try to do it any other way you will get in a world of pain.

  • any faster way

    This is a sample date in my viewobject

    ID title parentId
    ------------------------------------------------------------------------------------
    1 root - 1
    2 level2.1 1
    3 level2.2 1
    4 leaf1 2
    5 leaf2 3


    the parentID is a foreignkey ID, there is also a view link bettwen them.

    I want to load the entire tree, so I must firstly to iterate through the entire viewobjcet to find the root.
    then, when I want to find the root children, I have also to iterate through all viewobject.
    It's too slow.
    How can I make it faster? can I remove the line I have iterated, because he go only once.

    I don't know why you sort your data. If its sorted, only go you once in your VO, because you can assume that each following element is an element equivalent or lower. For best results, you can sort second the ID.

    id title    parentId
    1  root     -1
    2  level2.1  1
    3  level2.2  1
    4  leaf1     2
    6  level3.1  2
    5  leaf2     3
    7  level4.1  3
    8  leaf3     3
    

    First element is the root, because of parentId =-1. Second element is an element with parentId = 1 and so on. If the parentId is switching, you know, go to the next 'map' of your tree, the item following thereon, if the id of the sheet and the parentId of the new element are identical.

    It's not complicated and not waste your performance, just sorting.

    Concerning

    Majo

  • Discover a faster way to browset the web?

    When I open a browser Google page I get a message under the tool bar asking - discover a fater way to browse the we - install Google Chrome.
    If I say no and then open another tab of Google - it reappears again.
    How can I stop this message from appearing. Thank you

    Thanks for the quick response. I'll install Adblock more

Maybe you are looking for

  • delete other data out of my iphone

    OK, I tried all suggestions to delete the "other" data out of my phone, including a restoration. Restore seemed to work until I connected to iTunes again once and then he came right away. I have 4.38 GB of data and no amount of cleaning browser cache

  • 18.0 R Firefox displays my Google Contacts, but when I click on a contact, I can't open it. I'm unable to click and open any component of Contacts.

    I use Firefox 18.0 and Windows 7. Google Contacts support contacts, however, I am unable to open and edit individual contacts. Similarly, when I click on groups, more, try to go to the next page of contacts, change my settings (gear icon) or which gr

  • Generic queue?

    Hi all My project is to test SubVIs. I do this by writing a test VI calling SubVis. Good number of these SubVis take queues as inputs. Therefore, my test VI Gets a reference to a queue, fills a table queue, passes this reference in the Subvi tested,

  • Help running SimCity 4 on W7 64 bit pc / cursor problems

    Hi all - I have a brand new custom HP 450 t. Intel CPU quad core i 870 and 2BG GPU Radeon HD 5570. 8 GB of ram. I'm a * die hard * SimCity 4 players and you have installed the disk 1 and 2 on my machine without problem. During my 1st game play, the c

  • I need some drivers for amd radeon hd 7650 m

    HelloW, my English is not very good, but I try to expose my problem. I have laptop HP 4540 s with amd radeon hd 7650 m and Windows 7 Ultimete and I cannot find the drivers for this video card. This adapter does not work. What should I do? Thank you!