title: Why Oracle insert faster than Mysql
body: <p>I have a little compharison between oracle 11gR2 and Mysql 5.6.</p>
  
  <p>I create same schema in both DBMS with 3 tables
  --branch 
  --client
  --loan
  loan has a foreign key to client, and a client has a foreign key to branch, besides  all of them have primary keys.</p>
  
  <p>I created branches, and client (200_000 clients) and I wanna tests insert perfomance with loan table which is consist around 50 columns.</p>
  
  <p>Most of clolumns double or integer or string. </p>
  
  <pre><code>create or replace PROCEDURE create_loans( n number)
  as
  BEGIN
      Declare 
      i number:=0;
      randDouble float ;
      randInt number;
      randString varchar2(50);
      Begin
        while i &lt; n 
        Loop
           randDouble := ROUND(dbms_random.value(0,1),17);
           randInt := ROUND(dbms_random.value(1,100000000));
          randString := dbms_random.string('l', 50); 
  
          Insert into loan_row_model.loan values(null,
              randDouble,
              randDouble*10,
              randDouble*13,
              SUBSTR(randString,1,32),
              SUBSTR(randString,2,10),
              randDouble*155,
              SUBSTR(randString,1,9),
              SUBSTR(randString,9,10),
              SUBSTR(randString,1,32),
              randDouble*6123,--annual_inc
              SUBSTR(randString,3,32),--verification_status
              SUBSTR(randString,4,30),
              randDouble,
              randInt,--open_acc
              randInt*2,
              SUBSTR(randString,7,7),
          randInt*5,--total_acc
          SUBSTR(randString,1,3),--initial_list_status
              randDouble*64,
          randDouble*4,
          randDouble*231,
          randDouble,
          randDouble,
              randDouble*12,
              randDouble,--collection_recovery_fee
              SUBSTR(randString,19,30),
              randDouble*14,--last_pymnt_amnt
              SUBSTR(randString,21,32),
              SUBSTR(randString,9,30),
              SUBSTR(randString,16,15),--policy_code
              SUBSTR(randString,1,29),--application_type
              randInt,
              randInt*7,
              randInt*4,
              randInt,
              randInt,
              randInt,
              randInt*3,
              randInt,--mths_since_rcnt_il
              randDouble*6149,
              randInt*8,--open_rv_12m
              randInt*8,--open_rv_24m
              randDouble*475,
              randDouble*37,--all_util
              randInt*4,
              randInt,
              randInt*3,
              randInt,
              randInt*9,
              TO_DATE( TRUNC( DBMS_RANDOM.VALUE(TO_CHAR(DATE '2016-01-01','J'),TO_CHAR(DATE '2046-12-31','J') )),'J'),
              ROUND(dbms_random.value(1,200000))
              );
           i := i+1;
          end loop;
      end;
  END;
  </code></pre>
  
  <p>the procedure in mysql almost identical, I just used their native random generator for values.</p>
  
  <p>Before start I have disabled parallel executing in oracle, and flush cache, in mysql also disable cache.</p>
  
  <p>But as a result for 50000 inserts Oracle has 15s vs 30s in Mysql.</p>
  
  <p>What is the reason, could you help?</p>