title: Insert performance - Oracle vs Postgres
body: <p>I found this scenario; In oracle I have this table:</p>
  
  <pre><code>CREATE TABLE "MYSCHEMA"."MYTABLE" 
  (   
  "COL1" NUMBER, 
  "COL2" DATE, 
  "COL3" VARCHAR2(20 BYTE), 
  "COL4" NUMBER, 
  ....
  "COL34" VARCHAR2(2 BYTE)
  );
  CREATE INDEX "MYSCHEMA"."MYTABLE_INDEX3" ON "MYSCHEMA"."MYTABLE" ("COL4") 
  CREATE INDEX "MYSCHEMA"."MYTABLE_INDEX4" ON "MYSCHEMA"."MYTABLE" ("COL10") 
  CREATE INDEX "MYSCHEMA"."MYTABLE_INDEX5" ON "MYSCHEMA"."MYTABLE" ("COL1") 
  CREATE INDEX "MYSCHEMA"."MYTABLE_INDEX6" ON "MYSCHEMA"."MYTABLE" ("COL20") 
  CREATE INDEX "MYSCHEMA"."MYTABLE_INDEX1" ON "MYSCHEMA"."MYTABLE" ("COL3") 
  CREATE INDEX "MYSCHEMA"."MYTABLE_INDEX2" ON "MYSCHEMA"."MYTABLE" ("COL5") 
  
  CREATE TABLE MYSCHEMA.MYTABLE_AUX AS (SELECT * FROM MYSCHEMA.MYTABLE);
  </code></pre>
  
  <p>I replicated the same table for postgres; as you can see, mytable_aux has no indexes.</p>
  
  <p>In oracle, this query takes 157 seconds:</p>
  
  <pre><code>--table mytable count=0 rows
  --table mytable_aux=8.289.678 rows
  insert into MYSCHEMA.MYTABLE(select * from MYSCHEMA.MYTABLE_AUX); --175 seg
  </code></pre>
  
  <p>In postgres, with even less records, takes longer than 10 minutes</p>
  
  <pre><code>--table mytable count=0 rows
  --table mytable_aux=3.557.365 rows
  insert into myschema.mytable (select * from myschema.mytable_aux ); --10 minutes
  </code></pre>
  
  <p>Rest assured that the tables from the two db engines are equivalent and they manage the same records. Is there something I'm missing? how can I improve the postgres performance?</p>