[PERFORM] CopyManager(In/out) vs. delete/insert directly

2014-10-16 Thread Emi Lu
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

Re: [PERFORM] char(N), varchar(N), varchar, text

2014-10-08 Thread Emi Lu
For performance point of view, are there big differences between: char(N), varchar(N), varchar, text? Some comments from google shows: No difference, under the hood it's all varlena. Check this article from Depesz: http://www.depesz.com/index.php/2010/03/02/charx-vs-varcharx-vs-varchar-v

[PERFORM] char(N), varchar(N), varchar, text

2014-10-08 Thread Emi Lu
Good morning, For performance point of view, are there big differences between: char(N), varchar(N), varchar, text? Some comments from google shows: No difference, under the hood it's all varlena. Check this article from Depesz: http://www.d

[PERFORM] issue?

2014-10-06 Thread Emi Lu
Hello List, May I know will cause any potential performance issues for psql8.3 please? version (PostgreSQL 8.3.18 on x86_64-unknown-linux-gnu, compiled by GCC 4.1.2) E.g., got 10 idle connections for 10 days.  select current_query from

Re: [PERFORM] Which update action quicker?

2014-09-24 Thread Emi Lu
Hello, For a big table with more than 10 Million records, may I know which update is quicker please? (1) update t1 set c1 = a.c1 from a where pk and t1.c1 <> a.c1; .. update t1 set c_N = a.c_N from a where pk

[PERFORM] Which update action quicker?

2014-09-23 Thread Emi Lu
Hello list, For a big table with more than 1,000,000 records, may I know which update is quicker please? (1) update t1   set c1 = a.c1   from a   where pk and

Re: [PERFORM] autocommit (true/false) for more than 1 million records

2014-08-28 Thread Emi Lu
Hello All, I learned a lot by inputs from all of you. To share one more thing about java_JDBC bypassing autocommit that I tried: (1) Read/save source data into f1.csv, f2.csv, .. (2) Copy/load into dest psql.DB CopyManager cm = null; FileReader fileReader = null;

Re: [PERFORM] autocommit (true/false) for more than 1 million records

2014-08-25 Thread Emi Lu
Good morning, Trying to insert into one table with 1 million records through java JDBC into psql8.3. May I know (1) or (2) is better please? (1) set autocommit(true) (2) set autocommit(false) commit every n records (e.g., 100, 500, 1000, etc) It depends on what you need. Data will be ava

Re: [PERFORM] autocommit (true/false) for more than 1 million records

2014-08-22 Thread Emi Lu
* Trying to insert into one table with 1 million records through java JDBC into psql8.3. May I know (1) or (2) is better please? (1) set autocommit(true) (2) set autocommit(false) commit every n records (e.g., 100, 500, 1000, etc) It depends on what you need. Data will be available to co

[PERFORM] autocommit (true/false) for more than 1 million records

2014-08-22 Thread Emi Lu
Hello, Trying to insert into one table with 1 million records through java JDBC into psql8.3. May I know (1) or (2) is better please? (1) set autocommit(true) (2) set autocommit(false) commit every n records (e.g., 100, 500, 1000, etc) Thanks a lot! Emi -- Sent via pgsql-performance

[PERFORM] update - which way quicker?

2008-08-28 Thread Emi Lu
Good morning, Tried to compare Table1 based on Table2 . update table1.col = false if table1.pk_cols not in table2.pk_cols For the following two ways, (2) always performs better than (1) right, and I need your inputs. (