CopyManager(In/out) vs. delete/insert directly

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: CopyManager(In/out) vs. delete/insert directly
Date: 2014-10-16 18:30:54
Message-ID: 54400EDE.7030801@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello,

Two options for data (>1M), may I know which one better please?

(1) copyOut (JDBC copyManager)
t1 into a.csv
delete t2 where pk.cols in t1
copyIn t2 from a.csv

(2) setautoCommit(false);
delete t2 where pk.cols in t1;
insert t2 select * from t1;

Thank you
Emi

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2014-10-16 20:06:14 9.4 performance improvements test
Previous Message Дмитрий Шалашов 2014-10-16 17:22:20 Re: Partitioned tables and SELECT ... ORDER BY ... LIMIT