Re: [SQL] best performance for simple dml

2011-06-27 Thread Pavel Stehule
Hello 2011/6/27 chester c young > forgive me for brain storming a little re copy: > > if there are a limited number of tables you're inserting, would there be > anything wrong with the app opening a copy connection? ie, a connection > initiates the copy and then stays open like a pipe for any i

Re: [SQL] best performance for simple dml

2011-06-27 Thread chester c young
forgive me for brain storming a little re copy: if there are a limited number of tables you're inserting, would there be anything wrong with the app opening a copy connection?  ie, a connection initiates the copy and then stays open like a pipe for any inserts coming through it.  visually it's a

Re: [SQL] best performance for simple dml

2011-06-27 Thread Craig Ringer
On 27/06/11 15:05, Pavel Stehule wrote: > exec('begin'); > for(i = 0; i < 1000; i++) > exec("insert into foo values($1), itoa(i)); > exec('commit'); You can probably also benefit from multi-valued INSERTs, though I haven't verified this. INSERT INTO foo VALUES (1,'joe','dean'), (4,'fred','bob'

Re: [SQL] best performance for simple dml

2011-06-27 Thread chester c young
very nice pointers.  thank you very much! --- On Mon, 6/27/11, Pavel Stehule wrote: From: Pavel Stehule Subject: Re: [SQL] best performance for simple dml To: "chester c young" Cc: pgsql-sql@postgresql.org Date: Monday, June 27, 2011, 1:05 AM 2011/6/27 chester c young > > two questions: > I

Re: [SQL] best performance for simple dml

2011-06-27 Thread Pavel Stehule
2011/6/27 chester c young > > two questions: > I thought copy was for multiple rows - is its setup cost effective for one > row? I expect it will be faster for one row too - it is not sql statement if you want to understand to performance issues you have to understand to a) network communicati