Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5A48E1337B7D for ; Wed, 1 Dec 2010 10:03:27 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 36864-02 for ; Wed, 1 Dec 2010 14:03:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mail.postgresql.org (Postfix) with SMTP id 454BF133740B for ; Wed, 1 Dec 2010 10:03:18 -0400 (AST) Received: from source ([209.85.215.179]) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKTPZVpgTvz42yppPjh8TwSSBoWEZHBzhi@postini.com; Wed, 01 Dec 2010 06:03:19 PST Received: by mail-ey0-f179.google.com with SMTP id 24so3444490eyg.38 for ; Wed, 01 Dec 2010 06:03:17 -0800 (PST) Received: by 10.213.108.129 with SMTP id f1mr2317983ebp.10.1291212197503; Wed, 01 Dec 2010 06:03:17 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id b52sm9906eei.13.2010.12.01.06.03.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Dec 2010 06:03:16 -0800 (PST) Message-ID: <4CF655A3.4090308@enterprisedb.com> Date: Wed, 01 Dec 2010 16:03:15 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Joachim Wieland CC: Tom Lane , =?ISO-8859-1?Q?Jos=E9_Arthur_Beneta?= =?ISO-8859-1?Q?sso_Villanova?= , pgsql-hackers@postgresql.org Subject: Re: directory archive format for pg_dump References: <4CEA9F29.5060106@enterprisedb.com> <28890.1290445623@sss.pgh.pa.us> <4CEAD61A.6060207@enterprisedb.com> <4CF40B5F.1010407@enterprisedb.com> In-Reply-To: <4CF40B5F.1010407@enterprisedb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201012/41 X-Sequence-Number: 175303 On 29.11.2010 22:21, Heikki Linnakangas wrote: > On 29.11.2010 07:11, Joachim Wieland wrote: >> On Mon, Nov 22, 2010 at 3:44 PM, Heikki Linnakangas >> wrote: >>> * wrap long lines >>> * use extern in function prototypes in header files >>> * "inline" some functions like _StartDataCompressor, _EndDataCompressor, >>> _DoInflate/_DoDeflate that aren't doing anything but call some other >>> function. >> >> So here is a new round of patches. It turned out that the feature to >> allow to also restore files from a different dump and with a different >> compression required some changes in the compressor API. And in the >> end I didn't like all the #ifdefs either and made a less #ifdef-rich >> version using function pointers. > > Ok. The separate InitCompressorState() and AllocateCompressorState() > functions seem unnecessary. As the code stands, there's little > performance gain from re-using the same CompressorState, just > re-initializing it, and I can't see any other justification for them > either. > > I combined those, and the Free/Flush steps, and did a bunch of other > editorializations and cleanups. Here's an updated patch, also available > in my git repository at > git://git.postgresql.org/git/users/heikki/postgres.git, branch > "pg_dump-dir". I'm going to continue reviewing this later, tomorrow > hopefully. Here's another update. I changed things quite heavily. I didn't see the point of having the Alloc+Free functions for uncompressing, because the ReadDataFromArchive processed the whole input stream in one go anyway. So the new API consists of four functions, AllocateCompressor, WriteDataToArchive and EndCompressor for writing, and ReadDataFromArchive for reading. Also, I reverted the zlib buffer size from 64k to 4k. If you want to raise that, let's discuss that separately. Please let me know what you think of this version, or if you spot any bugs. I'll keep working on this, I'm hoping to get this into committable shape by the end of the week. The pg_backup_directory patch naturally won't apply over this anymore. Once we have the compress_io part in shape, that will need to be fixed. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com