Re: [HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-07-14 Thread Robert Haas
On Wed, Feb 10, 2010 at 12:19 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andrew Dunstan and...@dunslane.net writes: Tom Lane wrote: The code is only trying to substitute for something you can't have in parallel restore, ie --single-transaction. Exactly. IIRC that's why --single-transaction was

Re: [HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-07-06 Thread Marc Cousin
2010/2/10 Takahiro Itagaki itagaki.takah...@oss.ntt.co.jp Tom Lane t...@sss.pgh.pa.us wrote: Takahiro Itagaki itagaki.takah...@oss.ntt.co.jp writes: We have an optimization to bulkload date in pg_restore, but the code only works in parallel restore (--jobs = 2). Why don't we do the

[HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-02-09 Thread Takahiro Itagaki
We have an optimization to bulkload date in pg_restore, but the code only works in parallel restore (--jobs = 2). Why don't we do the same optimization in the serial restore (--jobs = 1) ? We checks is_parallel to decide to use BEGIN-TRUNCATE-COPY: if (is_parallel te-created) but we can

Re: [HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-02-09 Thread Tom Lane
Takahiro Itagaki itagaki.takah...@oss.ntt.co.jp writes: We have an optimization to bulkload date in pg_restore, but the code only works in parallel restore (--jobs = 2). Why don't we do the same optimization in the serial restore (--jobs = 1) ? The code is only trying to substitute for

Re: [HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-02-09 Thread Takahiro Itagaki
Tom Lane t...@sss.pgh.pa.us wrote: Takahiro Itagaki itagaki.takah...@oss.ntt.co.jp writes: We have an optimization to bulkload date in pg_restore, but the code only works in parallel restore (--jobs = 2). Why don't we do the same optimization in the serial restore (--jobs = 1) ? The

Re: [HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-02-09 Thread Andrew Dunstan
Tom Lane wrote: Takahiro Itagaki itagaki.takah...@oss.ntt.co.jp writes: We have an optimization to bulkload date in pg_restore, but the code only works in parallel restore (--jobs = 2). Why don't we do the same optimization in the serial restore (--jobs = 1) ? The code is only

Re: [HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-02-09 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Tom Lane wrote: The code is only trying to substitute for something you can't have in parallel restore, ie --single-transaction. Exactly. IIRC that's why --single-transaction was introduced in the first place. To me, --single-transaction is mostly

Re: [HACKERS] TRUNCATE+COPY optimization and --jobs=1 in pg_restore

2010-02-09 Thread Takahiro Itagaki
Andrew Dunstan and...@dunslane.net wrote: Takahiro-san is suggesting there is a case for doing the optimisation in non-parallel mode. But if we do that, is there still a case for --single-transaction? I think --single-transaction is useful to restore data into non-empty databases. A normal