Re: [PERFORM] really quick multiple inserts can use COPY?

2006-12-12 Thread nicky
Jens Schipkowski wrote: Thanks a lot to all for your tips. Of course, I am doing all the INSERTs using a transaction. So the cost per INSERT dropped from 30 ms to 3 ms. The improvement factor matches with the hint by Brian Hurt. Sorry, I forgot to mention we are using PostgreSQL 8.1.4.

[PERFORM] really quick multiple inserts can use COPY?

2006-12-11 Thread Jens Schipkowski
Hello! In our JAVA application we do multiple inserts to a table by data from a Hash Map. Due to poor database access implemention - done by another company (we got the job to enhance the software) - we cannot use prepared statements. (We are not allowed to change code at database access!)

Re: [PERFORM] really quick multiple inserts can use COPY?

2006-12-11 Thread Andreas Kretschmer
Jens Schipkowski [EMAIL PROTECTED] schrieb: Hello! In our JAVA application we do multiple inserts to a table by data from a Hash Map. Due to poor database access implemention - done by another company (we got the job to enhance the software) - we cannot use prepared statements. (We

Re: [PERFORM] really quick multiple inserts can use COPY?

2006-12-11 Thread Rajesh Kumar Mallah
So, my questions: Is it possible to use COPY FROM STDIN with JDBC? Should be. Its at least possible using DBI and DBD::Pg (perl) my $copy_sth = $dbh - prepare( COPY general.datamining_mailing_lists (query_id,email_key) FROM STDIN;) ; $copy_sth - execute(); while (my ($email_key ) =

Re: [PERFORM] really quick multiple inserts can use COPY?

2006-12-11 Thread Tom Lane
Jens Schipkowski [EMAIL PROTECTED] writes: Is it possible to use COPY FROM STDIN with JDBC? You should be asking the pgsql-jdbc list, not here. (I know I've seen mention of a JDBC patch to support COPY, but I dunno if it's made it into any official version.) Will it bring performance

Re: [PERFORM] really quick multiple inserts can use COPY?

2006-12-11 Thread Guillaume Cottenceau
Jens Schipkowski jens.schipkowski 'at' apus.co.at writes: Hello! In our JAVA application we do multiple inserts to a table by data from a Hash Map. Due to poor database access implemention - done by another company (we got the job to enhance the software) - we cannot use prepared

Re: [PERFORM] really quick multiple inserts can use COPY?

2006-12-11 Thread imad
On 12/11/06, Andreas Kretschmer [EMAIL PROTECTED] wrote: Jens Schipkowski [EMAIL PROTECTED] schrieb: Hello! In our JAVA application we do multiple inserts to a table by data from a Hash Map. Due to poor database access implemention - done by another company (we got the job to enhance the

Re: [PERFORM] really quick multiple inserts can use COPY?

2006-12-11 Thread Jens Schipkowski
Thanks a lot to all for your tips. Of course, I am doing all the INSERTs using a transaction. So the cost per INSERT dropped from 30 ms to 3 ms. The improvement factor matches with the hint by Brian Hurt. Sorry, I forgot to mention we are using PostgreSQL 8.1.4. Thanks for the code snippet