t
remove a connection cost, but nothing more. You can use a more connections
to do paralel inserts - it has a sense.
look on pgpool or other similar sw for connection pooling
Pavel
>
> --- On *Mon, 6/27/11, Pavel Stehule * wrote:
>
>
> From: Pavel Stehule
> Subject: Re:
it's a very cool paradigm, but is it actually a good idea?
--- 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 ches
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'
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
>
> tw
)
exec("insert into foo values($1), itoa(i));
exec('commit');
Regards
Pavel Stehule
>
> --- 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@po
two questions:
I thought copy was for multiple rows - is its setup cost effective for one row?
copy would also only be good for insert or select, not update - is this right?
--- On Mon, 6/27/11, Pavel Stehule wrote:
From: Pavel Stehule
Subject: Re: [SQL] best performance for simple dml
To
Hello
try it and you will see. Depends on network speed, hw speed. But the most
fast is using a COPY API
http://www.postgresql.org/docs/9.0/interactive/libpq-copy.html
Regards
Pavel Stehule
2011/6/27 chester c young
> what is the best performance / best practices for frequently-used simple
what is the best performance / best practices for frequently-used simple dml,
for example, an insert
1. fast-interface
2. prepared statement calling "insert ..." with binary parameters
3. prepared statement calling "myfunc(..." with binary parameters; myfunc takes
its arguments and performs an in