Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XN10p-0005cC-U3 for pgsql-performance@arkaria.postgresql.org; Thu, 28 Aug 2014 14:49:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XN10p-0006z3-Ec for pgsql-performance@arkaria.postgresql.org; Thu, 28 Aug 2014 14:49:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XN10o-0006yj-Ak for pgsql-performance@postgresql.org; Thu, 28 Aug 2014 14:49:18 +0000 Received: from oldperseverance.encs.concordia.ca ([132.205.96.92]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XN10h-0003KU-2s for pgsql-performance@postgresql.org; Thu, 28 Aug 2014 14:49:16 +0000 Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by oldperseverance.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id s7SEn8UL025199; Thu, 28 Aug 2014 10:49:08 -0400 Message-ID: <53FF4164.9070102@encs.concordia.ca> Date: Thu, 28 Aug 2014 10:49:08 -0400 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Kevin Grittner , Alex Goncharov CC: "pgsql-performance@postgresql.org" Subject: Re: autocommit (true/false) for more than 1 million records References: <53F7ACF4.1010604@encs.concordia.ca> <1409092428.41025.YahooMailNeo@web122306.mail.ne1.yahoo.com> <1409144369.45962.YahooMailNeo@web122306.mail.ne1.yahoo.com> In-Reply-To: <1409144369.45962.YahooMailNeo@web122306.mail.ne1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on oldperseverance.encs.concordia.ca at 2014/08/28 10:49:08 EDT X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hello All, I learned a lot by inputs from all of you. To share one more thing about java_JDBC bypassing autocommit that I tried: (1) Read/save source data into f1.csv, f2.csv, ...... (2) Copy/load into dest psql.DB CopyManager cm = null; FileReader fileReader = null; cm = new CopyManager((BaseConnection) conn_psql); fileReader = new FileReader("f1.csv"); cm.copyIn("COPY table_name FROM STDIN WITH DELIMITER '|'", fileReader); fileReader.close(); Emi On 08/27/2014 08:59 AM, Kevin Grittner wrote: > Alex Goncharov wrote: >> Kevin Grittner wrote: >>> The rows will all be in the table, but not visible to any other >>> transaction. >> How much data can I fit there while doing COPY? Not 1 TB? > As has already been said, why not? This is not some special > section of the table -- the data is written to the table. Period. > Commit or rollback just tells new transactions whether data flagged > with that transaction number is visible. > > Nobody can tell you how much space that will take -- it depends on > many factors, including how many columns of what kind of data, how > compressible it is, and how it is indexed. But the point is, we > are not talking about any separate space from what is needed to > store the data in the database. > > FWIW, I think the largest single COPY statement I ever ran was > generated by pg_dump and piped directly to psql for a major release > upgrade (before pg_upgrade was available), and it was somewhere in > the 2TB to 3TB range. It took a long time, but it "just worked". > That should be true for 10TB or 100TB, as long as you have sized > the machine correctly and are loading clean data. Whether you have > that covered, and how you want to "hedge your bets" based on your > degree of confidence in those things is a judgment call. When I'm > in the position of needing to make such a call, I like to do some > tests. > > -- > Kevin Grittner > EDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance