Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk929-0001eP-1G for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 19:43:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk928-0004Uj-0v for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Apr 2023 19:43:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk927-0004UY-ND for pgsql-hackers@lists.postgresql.org; Wed, 05 Apr 2023 19:43:03 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pk924-0016hs-MS for pgsql-hackers@postgresql.org; Wed, 05 Apr 2023 19:43:03 +0000 Received: by mail-ed1-x536.google.com with SMTP id ek18so143899580edb.6 for ; Wed, 05 Apr 2023 12:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1680723780; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=06YXZ/QXhClMtwiaeXQ2d4EHAiuURXe6TrogCi7g4is=; b=bRMB2TYc50uRIqdLehso8qlhjvQ9MbNsjkCCcK87wspMXh+VBuqnX3fYFtvKkr2gnc 93nP98DQWBwNsRazfpyQpeMx+435b1TOi8hCiVJkvmYhIJuGYbxyDVnoa9DsmWq5P5cX 9QYEjgFujAqK+NbT8EA5BjAWxFIbcSI4e2jUfHSLJXql2vf94mRbU0LwScchIv09N9LX qDXzKcNX7eT7+kzF9KQ0/wb1fX27kg2Buq8p4b5XhhI73dKMAXPK8oLZbCGJejCnvvOj O7IhTJ+83d8Ntoh/1EEDJSIuU2G0rxzsGU8Pt/75QDB0T3GQafG6MTIHtnIkVtWXaZj+ cNYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680723780; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=06YXZ/QXhClMtwiaeXQ2d4EHAiuURXe6TrogCi7g4is=; b=liX4temGQA0FtOOI+lwI1hWmZjfk67B3Frp84R4ZxUaXR09IB4V9cwm2F/MRGQPXTe JS3ympq71NWQLtSuXmGwNcvwee1MvSVvYrCsCqhyAVCio5JEZVDnUMtVqsGHMpoS5Obv QdrDqM5i1S+w8k7fkl2VH1OflWpVI/9rjHJcTWydwlExySF8CmpEp7vlktsbKNbna/AH Vbkdnzy22gZwnBB/cCQwHfe8+8T3GYZR27K7lVE/Adp+grNIqQM2v7nGJCzkkaV2YzF1 9U0+biHfq9BKtQ8NmUe9MUgCncnkK7kbgaiKkpILsibc/7feU8pp5mISm1ve1+PIWJ5S izrQ== X-Gm-Message-State: AAQBX9cwhxhBv4VI1DDE4pUtU9tAzMW3f38bwleoCMeMCS4gz6DV1XWe aSw/j4/tEc5UQnlIbucGCFNvdst1dKW5VtKdno3JRmHpXsSmt46PF/SdQ3P0bFLJQK2PZ+cIJ5h FZi49LFU3OTm6QqA9Y79erx3E7KTBIgDZce1QNNKtr1alPAWY/zZh1F1zcxQ4Sgw1wcZ6Hur+2F TC/IyLYxrhF6kpvu8ROsHHz3zC2+Eja45qWmox X-Google-Smtp-Source: AKy350bRubKnPq0ZlAweZk7Dg3F6FCg5rKGTHyh9iZ9iTbs+Voj+0iRf+katqpEE+nmwXeg6rwkkPQ== X-Received: by 2002:a17:906:138f:b0:92c:6fbf:28 with SMTP id f15-20020a170906138f00b0092c6fbf0028mr4851754ejc.64.1680723779635; Wed, 05 Apr 2023 12:42:59 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-226-121.bb.vodafone.cz. [86.49.226.121]) by smtp.gmail.com with ESMTPSA id be6-20020a1709070a4600b00949173c1dcfsm2623596ejc.18.2023.04.05.12.42.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Apr 2023 12:42:59 -0700 (PDT) Message-ID: <51013008-6735-96a2-d744-3b0a0413fcdd@enterprisedb.com> Date: Wed, 5 Apr 2023 21:42:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: zstd compression for pg_dump Content-Language: en-US To: Justin Pryzby Cc: Jacob Champion , pgsql-hackers@postgresql.org, gkokolatos@pm.me, Michael Paquier , Robert Haas , Peter Geoghegan , Peter Eisentraut , Heikki Linnakangas , Thomas Munro , Dipesh Pandit , Andrey Borodin , Mark Dilger References: <0022dd9e-a439-d72f-d09b-ec512c23949b@enterprisedb.com> <4029fe58-f661-7d8d-cbbb-b936a05531e2@enterprisedb.com> <2de3bcad-6da9-9022-bce5-fc0416351d6e@enterprisedb.com> <27eb89fc-8fdd-2988-0959-0af1d6d7a12a@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/4/23 05:04, Justin Pryzby wrote: > On Mon, Apr 03, 2023 at 11:26:09PM +0200, Tomas Vondra wrote: >> On 4/3/23 21:17, Justin Pryzby wrote: >>> On Sat, Apr 01, 2023 at 10:26:01PM +0200, Tomas Vondra wrote: >>>>> Feel free to mess around with threads (but I'd much rather see the patch >>>>> progress for zstd:long). >>>> >>>> OK, understood. The long mode patch is pretty simple. IIUC it does not >>>> change the format, i.e. in the worst case we could leave it for PG17 >>>> too. Correct? >>> >>> Right, libzstd only has one "format", which is the same as what's used >>> by the commandline tool. zstd:long doesn't change the format of the >>> output: the library just uses a larger memory buffer to allow better >>> compression. There's no format change for zstd:workers, either. >> >> OK. I plan to do a bit more review/testing on this, and get it committed >> over the next day or two, likely including the long mode. One thing I >> noticed today is that maybe long_distance should be a bool, not int. >> Yes, ZSTD_c_enableLongDistanceMatching() accepts int, but it'd be >> cleaner to cast the value during a call and keep it bool otherwise. > > Thanks for noticing. Evidently I wrote it using "int" to get the > feature working, and then later wrote the bool parsing bits but never > changed the data structure. > > This also updates a few comments, indentation, removes a useless > assertion, and updates the warning about zstd:workers. > Thanks. I've cleaned up the 0001 a little bit (a couple comment improvements), updated the commit message and pushed it. I plan to take care of the 0002 (long distance mode) tomorrow, and that'll be it for PG16 I think. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company