Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YfiCh-0001Iz-2F for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2015 05:07:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YfiCg-00026c-DD for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2015 05:07:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YfiCf-00026T-Hs for pgsql-hackers@postgresql.org; Wed, 08 Apr 2015 05:07:05 +0000 Received: from mail-by2on0660.outbound.protection.outlook.com ([2a01:111:f400:fc0c::660] helo=na01-by2-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YfiCa-0005cC-Cz for pgsql-hackers@postgresql.org; Wed, 08 Apr 2015 05:07:04 +0000 Received: from decina.attlocal.net (2602:306:ce8b:3460:c525:d990:35a3:484e) by BLUPR11MB0676.namprd11.prod.outlook.com (25.163.216.146) with Microsoft SMTP Server (TLS) id 15.1.130.23; Wed, 8 Apr 2015 05:06:50 +0000 Message-ID: <5524B762.5060407@BlueTreble.com> Date: Wed, 8 Apr 2015 00:06:42 -0500 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Michael Paquier , Robert Haas CC: Ronan Dunklau , pgsql-hackers Subject: Re: pg_dump / copy bugs with "big lines" ? References: <1836813.YmyOrS99PX@ronan.dunklau.fr> <5519E025.3030704@BlueTreble.com> <7521105.6Ff26iknIn@ronan.dunklau.fr> <5522C7BC.3070705@BlueTreble.com> In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2602:306:ce8b:3460:c525:d990:35a3:484e] X-ClientProxiedBy: BN1PR12CA0038.namprd12.prod.outlook.com (25.160.77.48) To BLUPR11MB0676.namprd11.prod.outlook.com (25.163.216.146) Authentication-Results: postgresql.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR11MB0676; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(377454003)(51444003)(479174004)(62966003)(40100003)(50466002)(87976001)(19580405001)(36756003)(53416004)(122386002)(42186005)(47776003)(23746002)(19580395003)(93886004)(76176999)(83506001)(15975445007)(50986999)(54356999)(65816999)(33656002)(77156002)(92566002)(2950100001)(46102003)(65956001)(86362001)(3826002)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR11MB0676; H:decina.attlocal.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BLUPR11MB0676; BCL:0; PCL:0; RULEID:; SRVR:BLUPR11MB0676; X-Forefront-PRVS: 0540846A1D X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2015 05:06:50.1086 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR11MB0676 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 4/7/15 10:29 PM, Michael Paquier wrote: > On Wed, Apr 8, 2015 at 11:53 AM, Robert Haas wrote: >> On Mon, Apr 6, 2015 at 1:51 PM, Jim Nasby wrote: >>> In any case, I don't think it would be terribly difficult to allow a bit >>> more than 1GB in a StringInfo. Might need to tweak palloc too; ISTR there's >>> some 1GB limits there too. >> >> The point is, those limits are there on purpose. Changing things >> arbitrarily wouldn't be hard, but doing it in a principled way is >> likely to require some thought. For example, in the COPY OUT case, >> presumably what's happening is that we palloc a chunk for each >> individual datum, and then palloc a buffer for the whole row. Now, we >> could let the whole-row buffer be bigger, but maybe it would be better >> not to copy all of the (possibly very large) values for the individual >> columns over into a row buffer before sending it. Some refactoring >> that avoids the need for a potentially massive (1.6TB?) whole-row >> buffer would be better than just deciding to allow it. > > I think that something to be aware of is that this is as well going to > require some rethinking of the existing libpq functions that are here > to fetch a row during COPY with PQgetCopyData, to make them able to > fetch chunks of data from one row. The discussion about upping the StringInfo limit was for cases where a change in encoding blows up because it's now larger. My impression was that these cases don't expand by a lot, so we wouldn't be significantly expanding StringInfo. I agree that buffering 1.6TB of data would be patently absurd. Handling the case of COPYing a row that's >1GB clearly needs work than just bumping up some size limits. That's why I was wondering whether this was a real scenario or just hypothetical... I'd be surprised if someone would be happy with the performance of 1GB tuples, let alone even larger than that. -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers