What is better/more-fast: indexes all first or inserts first?

I created a couple of TABLEs.

Now I have todo, more than two tasks:

1.) Insert about 50000 to 100000 records in each TABLE
2.) CREATE index for these tables

What is better/more-fast:

Do not perform on the first task 1. or a task 2?

Peter

If it is possible to load the data in ascending order (linked to index), consider this note of documentation of CREATE INDEX:

KIND | NOSORT
By default, Oracle database sorts the index in ascending order, when it creates the index. You can specify NOSORT to indicate to the database that the lines are already stored in the database in ascending order, so that the Oracle database is not necessary to sort the rows when you create the index. If the indexed column lines are not stored in ascending order, then the database returns an error. For most saves space and time to sort, use the following clause immediately after the initial loading of rows in a table. If you specify any of these keywords, then SORT is the default value.

Tags: Database

Similar Questions

  • What is better/more quick method to create a table (Oracle 11 g 2 dB)?

    Assuming that there are no statistics for the source tables - tables are deleted and recreated every day

    My paintings have a few million lines

    I'm trying to create a filled with data as quickly as possible via

    1 createtable_name as SELECT * from emp;

    2. create table_name

    Parallel degree 4

    in SELECT * from EMP ;


    I have 1 case I had some time 34 Sec

    In case 2, the table was created in 15 Sec


    In oracle other possibilities to create a much faster with this DEC?


    Or it will be faster when I create a table using create table_name

    (

    column1datatype [NULL |] NOT NULL],

    column2datatype [NULL |] NOT NULL],

    ...

    column_ndatatype [NULL |] NOT NULL]

    );

    or maybe I should use this method

    INSERT /*+ APPEND */ INTO empSELECT * FROM all_objects;

    INSERT /*+ APPEND_VALUES */ INTO emp SELECT * FROM all_objects;

    or it is better to simply creating a table

    and to use the FORALL in BULK IN THE COLLECTION instruction

    combination of Pentecost of the

    INSERT / * + APPEND * / INTO emp;


    I encourage you to test different options - as you did for the first two variants: personally, I think that it is much easier to remember these things if I did the tests myself - instead of trusting in the results of others. IE I don't think that there is something more fast parallelized ETG (perhaps with a clause (*)) additional nologging by using path direct inserts (although that INSERT APPEND select should do the same). I expect the operations in PL/SQL block to be slower.

    (*), but you should consider the consequences of NOLOGGING for your backup strategies + recovery

  • IP number looking for PSI - need help with a sql solution better and faster

    Hello

    I have a table (one) with more 1 000 000 IP addresses and numbers (the digital equivalent of the IP address)

    I have a second table (b) which contains a mapping between the ranges of the ISP and IP. The table looks like this and more contains 150 000 entries:

    BEGIN_IP_RANGE END_IP_RANGE ISP_NAME

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

    600000000 700000000 ISP_X

    800000000 900000000 ISP_Y

    I'm creating a third table (c) which connects (a) IP numbers to identify the ISP from (B). The query looks like this:

    CREATE TABLE c

    AS

    Select a.IP_ADDRESS

    b.ISP_NAME

    IP_NUMBERS a, ISP_LOOKUP b lkp

    where a.IP_NUMBER between b.BEGIN_IP_RANGE and b.END_IP_RANGE

    ;

    There is no key join between the 2 tables and so I use TO search for the access provider. The performace of it's terrible and table (c) takes several hours to create.

    Does anyone have any thoughts/ideas/suggestions on how this research can be achieved by using a solution better and faster?

    Thank you very much

    Shah

    The performace of it's terrible and table (c) takes several hours to create.

    Hours what do you say?

    See if the following can help.

    Cardinalities are similar to yours. The ETG takes 7sec. :

    SQL> create table ip_numbers (ip_address, ip_number) as
      2  select cast(to_char(level,'fm099G999G999G999', 'nls_numeric_characters=,.') as varchar2(15))
      3       , level
      4  from dual
      5  connect by level <= 1000000 ;
    
    Table created.
    
    SQL> select * from ip_numbers where rownum <= 10;
    
    IP_ADDRESS       IP_NUMBER
    --------------- ----------
    000.000.000.001          1
    000.000.000.002          2
    000.000.000.003          3
    000.000.000.004          4
    000.000.000.005          5
    000.000.000.006          6
    000.000.000.007          7
    000.000.000.008          8
    000.000.000.009          9
    000.000.000.010         10
    
    10 rows selected.
    
    SQL>
    SQL> create table isp_lookup (begin_ip_range, end_ip_range, isp_name) as
      2  select 1 + (level-1)*5
      3       , level*5
      4       , cast('ISP_'||to_char(level,'fm099999') as varchar2(10))
      5  from dual
      6  connect by level <= 200000 ;
    
    Table created.
    
    SQL> select * from isp_lookup where rownum <= 10;
    
    BEGIN_IP_RANGE END_IP_RANGE ISP_NAME
    -------------- ------------ ----------
                 1            5 ISP_000001
                 6           10 ISP_000002
                11           15 ISP_000003
                16           20 ISP_000004
                21           25 ISP_000005
                26           30 ISP_000006
                31           35 ISP_000007
                36           40 ISP_000008
                41           45 ISP_000009
                46           50 ISP_000010
    
    10 rows selected.
    
    SQL> create index ip_address_number_ix on ip_numbers (ip_number);
    
    Index created.
    
    SQL> set timing on
    SQL>
    SQL> create table ip_mappings as
      2  select /*+ use_nl(a b) */
      3         a.ip_address
      4       , b.isp_name
      5  from isp_lookup b
      6       join ip_numbers a on a.ip_number between b.begin_ip_range
      7                                            and b.end_ip_range
      8  ;
    
    Table created.
    
    Elapsed: 00:00:06.94
    SQL> select count(*) from ip_mappings;
    
      COUNT(*)
    ----------
       1000000
    
    Elapsed: 00:00:01.22
    
  • How COUNT (*) SELECT all first before returning SELECT *.

    Our interface involves a grid filled by a SELECT query. The records are retrieved via a complex query with many tables involved and spent many filtering parameters. A simplified example:

    SELECT col1, col2,... colx

    OF tab1 tab2, tab 3 t3 t2, t1, etc.

    WHERE

    T1.Key1 = t2.key1

    and t2.key2 = t3.key2,

    and... etc.

    and t1.coldate > p_FilterDateFrom

    and t1.coldate < p_FilterDateTo

    and t2.somefield = p_FilterSomeFilter

    and t3.someotherfield = p_FilterSomeOtherField

    and... etc.

    Generally, the user enters parameters, so a small, manageable resultset is returned.

    But sometimes the user will enter the parameters that returns thousands of lines. As a result, the frontend in IE makes a break from time to time say ' Stop running this script? A script on this page slows down your web browser to run slowly... »

    I would like to run the above example query with a COUNT (*) SELECT all first before running the actual SELECT col1, col2, col3. This way if the rows returned exceeds a certain threshold, say, 500 lines, I could pop a message saying "more than 500 rows will be returned. Do you want to continue? ». If the user clicks Yes, then I go ahead and perform the actual query and fill the grid. If the user clicks on no, then the user gets a chance to adjust its settings.

    Y at - it an easy way to do short of coding (essentially) two versions of the same complex query, one for "SELECT COUNT (*)" and the other for "SELECT?"

    Thank you.

    Hey, Justin (or someone else). I quite agree with you on this... However, just to play the lawyer of the devil for a second... (or maybe not... so why I asked)

    The COUNT (*) Analytics as a separate and additional column has been added to the query would be a significant hit to the performance? I have simply discarded with a little, but set of samples was not big enough - I'll try a larger, later when I get time.

    something like:

    1. SELECT *.
    2. DE)
    3. SELECT col1, col2,... colx, count (*) NTC)
    4. OF tab1 tab2, tab 3 t3 t2, t1, etc.
    5. WHERE
    6. T1.Key1 = t2.key1
    7. and t2.key2 = t3.key2,
    8. and... etc.
    9. and t1.coldate > p_FilterDateFrom
    10. and t1.coldate<>
    11. and t2.somefield = p_FilterSomeFilter
    12. and t3.someotherfield = p_FilterSomeOtherField
    13. and... etc.
    14. order of something)
    15. where rownum<=>

    So, you can then enter the total number of any line (probably the first) and know how much you have?

    I'm sure it's more work than simply without... However, I guess that the real question... How much better it is than to the separate account? (if applicable)

  • It would be better and faster?

    Please look at the code segments mentioned in "BOLD",

    1)________________________________

    DECLARE
    BOOLEAN my_variable;
    BEGIN
    IF NVL(my_var,FALSE) THEN
    dbms_output.put_line ('Fake');
    ON THE OTHER
    dbms_output.put_line ('Genuine');
    END IF;
    END;

    2)_________________________________

    DECLARE
    BOOLEAN my_variable;
    BEGIN
    IF my_variable = FALSE THEN
    dbms_output.put_line ('Fake');
    ON THE OTHER
    dbms_output.put_line ('Genuine');
    end if;
    END;


    One who performs better and faster?

    If the answer is 2; Why the NVL() function was introduced? {: 8}

    First of all the NVL(my_var,FALSE) IF THEN and IF my_variable = FALSE THEN have different meanings!

    IF NVL(my_var,FALSE) THEN will be true only if the value of my_variable is true
    and
    IF my_variable = FALSE THEN values under this instruction will be executed when my_variable is false!

    * 009 *.

  • Updated my phone and now it won't let me back in without activating it all first.

    Hello, I was wondering if there was someone who could help me. Updated my phone and now it won't let me back in without activating it all first. Then I entered the Apple ID and password, and he repeated that they were all both wrong. So I double checked my ID on Apple's site, and it was the same one that I entered. I've also updated my password. My phone still telling me that my references are false. I can't call someone, because I'm locked out of my phone. I can't use my email in relief, because it requires a text on my phone, and I can't call Apple... because, well, I'm stuck on my phone. My fiance is not here, so I can't use her phone. Does anyone have any ideas as to what I can do?

    < re-titled by host >

    What the exact text of the error message you see when you try to activate the device? Say that the two are bad is a bit vague and doesn't look like an I've heard before. It is important to determine what exactly is the problem.

  • My wife has an i5 to 2.3 GHz MacBook Pro early 2011 and it worked like a slug.  Ran disk utility and verified that the disk needs repair using recovery HD.  What does this lead and what is the risk of losing all the data is there?

    My wife has an i5 to 2.3 GHz MacBook Pro early 2011 and it worked like a slug.  Ran disk utility and verified that the disk needs repair using recovery HD.  What does this lead and what is the risk of losing all the data is there?

    Even if it is very slow, you must make a return upwards before the race "repair disk". The risk of data loss is minimal, but do it anyway: Save and run to repair the disk.

    As for what it implies - most of the time nothing more than simply sitting and waiting to do his thing.

  • IPhone more heated 6s all of a sudden.

    IPhone more heated 6s all of a sudden.

    Hello s60rp10n_o7,

    Thank you for using communities Support from Apple!

    I understand from your question, that your iPhone has become hotter than expected. This may be normal or expected behavior, according to what the iPhone does. The following article contains more information on this.

    When the device or charging the battery, it is normal for it to warm up. The outside of the machine works like a surface of cooling that transfers heat from inside the unit to the outside fresh air.

    Keep the iPhone, iPad and iPod touch in acceptable operating temperatures - Apple Support

    See you soon!

  • (Bible Library 7) program has worked on this PC when I installed it all first, but after a few updtes it won't work

    (Bible Library 7) program has worked on this PC when I installed it all first.  After that a few updates have been installed on around 18/05/12 it has not worked. I uninstalled at least 3 times now and it won't work says incompatible application.  Another thing I did was select run as personal button I think I've done worse. I don't know how to deselect or cancel that. It is to select pack 2 for XP, it does not work. I don't see Windows 7 in the list of compatlble.

    Original title: program compatibility Application Applications App Apps game games Legacy Crash crashes Hang hangs

    If you are running Windows 7, then you don't benefit from this solution in the list Compatibility Mode as the Mode by default when nothing else is checked.

    What is your program?  If so, take a look around the site for technical assistance.  What's the story with the tab 'Locked' on this site?

    http://www.biblelibrary.com/4.html

    This allows to cancel all the settings you can do on the Compatibility Mode.

    Windows 7 - Compatibility Mode
    http://www.SevenForums.com/tutorials/316-compatibility-mode.html

    Your program works in Mode safe mode, or through the clean boot procedure?

    Startup options (including safe mode)
    http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-mode

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/default.aspx/KB/929135

    Have you tried to test with another Windows user?

  • I use Windows XP - what is better/less expensive to switch to Win7?

    All indications are that I should switch to Win7 - what is cheapes, more quick way to do this?

    Hello

    "To upgrade your Windows XP computer to Windows 7, you will need to select custom during installation of Windows 7. A custom installation keeps your programs, files or settings. It is sometimes called a 'clean' for this reason installation.

    A custom installation is more complex, and it can sometimes take a couple of hours to complete. We created this tutorial in five steps to guide you through the process every step of the way. »

    http://Windows.Microsoft.com/en-us/Windows7/help/upgrading-from-Windows-XP-to-Windows-7

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Before purchasing Windows 7, follow these steps:

    Go to your computer / computer laptop manufacturer Web site and see if Windows 7 drivers are available for your make and model computer / laptop.

    If this is not available, Windows 7 will not properly work for you.

    Run the "Windows 7 Upgrade Advisor.

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=20

    Check if your specifications are compatible for Windows 7:

    "Windows 7 system requirements"

    http://Windows.Microsoft.com/en-us/Windows7/products/system-requirements

    "Windows 7 Compatibility Center" for software and hardware:

    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/default.aspx

    Windows 7 upgrade paths:

    http://TechNet.Microsoft.com/en-us/library/dd772579 (v = ws.10) .aspx

    «Installation and reinstallation of Windows 7»

    http://Windows.Microsoft.com/en-us/Windows7/installing-and-reinstalling-Windows-7

    And the Microsoft Store where you can get an idea of the price of Windows 7:

    http://www.microsoftstore.com/store/msstore/en_US/list/CategoryID.50726100

    See you soon.

  • What privileges granted to select from all the PDB files

    Why the two selected does not return the same result? Or if you want the broader question - what privileges granted to select from all the PDB files.


    I want to leave common user that I created to select and see all of the synonyms of all PDB files.


    conn / as sysdba

    create user c##nir identified by c##nir container=all;

    grant connect,dba,resource to c##nir container=all;
    grant select on cdb_synonyms to c##nir container=all;

    select CON_ID  from cdb_synonyms  group by CON_ID;

      CON_ID
    ----------
      
    1
      
    4
      
    11
      
    10
      
    14
      
    5
      
    8
      
    13
      
    3
      
    7
      
    15
      
    6
      
    12
      
    9

    conn c
    ##nir/c##nir

    select CON_ID  from cdb_synonyms  group by CON_ID;

      CON_ID
    ----------
      
    1

    select CON_ID  from containers(dba_synonyms)  group by CON_ID
      
    *
    ERROR at line
    1:
    ORA-00942
    : table or view does not exist

    You must use the CONTAINER_DATA clause:

    ALTER USER ##nir set container_data = container c all = current;

    After running the above command, try to select again to cdb_synonyms and you will see the data of all containers.

    Read more in my Post of Blog

  • What is better to buy?

    Hi I have an online store and I need to buy for my Web Designer, the following software:

    Photoshop

    Illustrator

    In the design

    Lightroom

    FontExplorer

    Y at - it a package or I need to buy them individually?

    What is better and cheaper to buy?

    Thank you.

    The plan includes all Adobe Creative Cloud desktop applications:

    http://www.Adobe.com/creativecloud/catalog/desktop.html

    I don't think Fontexplorer is an Adobe product, but others are included.

  • Please I have iPhone 6 more stopped working all of a sudden shows apple logo then black screen I can solution?

    Please I have iPhone 6 more stopped working all of a sudden shows apple logo then black screen I can solution?

    Have you tried to restart the iPhone by pressing and maintaining the sleep/wake and home buttons?

  • 5532 the desire: what size paper more big, I can print on the use of hp envy 5532

    What size paper more big, that I can use with this printer envy 5532

    Hi @traciekm,

    Welcome to the HP Forums!

    I noticed you're wondering what is the largest size paper you can print using the HP Envy 5532. I'm happy to take a look for you!

    According to your specifications of the printer, the paper sizes supported include:

    Sizes and paper types supported: (ordinary, inkjet, photo)

    Type of paper
  • How to check what Qt application is run for the first time?

    How to check what Qt application is run for the first time? I need for the creation of trial version of my application. Any help is greatly appreciated

    Probably use file data and put an I_ran_at_least_one_time file and verify its existence. This file is not accessible to the user and is not changed even if you upgrade the application.

Maybe you are looking for