Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 66C856340C2 for ; Wed, 26 Aug 2009 13:40:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 51690-08 for ; Wed, 26 Aug 2009 16:40:18 +0000 (UTC) X-Greylist: delayed 00:09:49.60207 by SQLgrey-1.7.6 Received: from megafon.hr (megafon.hr [213.202.104.5]) by mail.postgresql.org (Postfix) with ESMTP id 5FF72634CEA for ; Wed, 26 Aug 2009 13:38:42 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by megafon.hr (Postfix) with ESMTP id 64BF625005B for ; Wed, 26 Aug 2009 18:28:50 +0200 (CEST) X-Virus-Scanned: ClamAV at megafon.hr Received: from megafon.hr ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zGps5qO1SylA for ; Wed, 26 Aug 2009 18:28:45 +0200 (CEST) Received: from [192.168.1.94] (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mike) by megafon.hr (Postfix) with ESMTPSA id 448FC25004E for ; Wed, 26 Aug 2009 18:28:45 +0200 (CEST) Message-ID: <4A9562BC.8030804@megafon.hr> Date: Wed, 26 Aug 2009 18:28:44 +0200 From: Mario Splivalo User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Inserting 'large' amounts of data Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/62 X-Sequence-Number: 19911 I have a web application which allows users to upload a lot of phone numbers. I need to store those numbers to a database. Usualy, one would upload around 70k-100k of records, totaling around 2 MB in size. I'm using tomcat as an application server, and JDBC to connect to pg8.3 database. I will have around 20-50 concurent users in peek hours, and even that is quite overestimated. I could create the temporary file on the filesystem where database cluster is located and then execute COPY mytable FROM '/tmp/upload-data/uuidofsomesort.csv' WITH CSV', but the 'problem' is that database server and tomcat reside on different physical machines. What would one recommend as the best way to insert those data? Mario