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 1pjRgw-0006W6-LJ for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Apr 2023 21:26:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjRgv-0003xL-G0 for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Apr 2023 21:26:17 +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 1pjRgv-0003xC-69 for pgsql-hackers@lists.postgresql.org; Mon, 03 Apr 2023 21:26:17 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pjRgs-000hbq-1z for pgsql-hackers@postgresql.org; Mon, 03 Apr 2023 21:26:16 +0000 Received: by mail-ed1-x52f.google.com with SMTP id h8so122785329ede.8 for ; Mon, 03 Apr 2023 14:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1680557171; 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=qk+fTfsoYxNqsfcPTS3ZXK+AMOmYGQpaWA52pwBvFpE=; b=i05sTBKXuItTvpKAJ7dHapVSnjLekfYiySylRxKM+2IqCgF1OxfCenZN4z46hzWBpG STf7ShF9xnnN0Das0jNRBgbAme2LUC3Hc/NMebsu+5zSNMg7JKRFUGaJVzcNTvKZ5E82 029uHVTI2BxBPzJBtIhPluUvfYJNnuX7O3KfYJf0Lv+Btdtih6DSs2Y+qUuYPahYWfW8 Ib81RpM/gLf2J0hoxWWhMOeYzKtZr+xv6cJtRBstO7nNCyGiQrEk+tjedNVASLyiuUhZ HC98NSD7Qv5I/pf1XTcSJBbQh8AtT42A1VtKt6jwR4KQH6lP5qf7akII9WrNM8GA4hRe 95bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680557171; 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=qk+fTfsoYxNqsfcPTS3ZXK+AMOmYGQpaWA52pwBvFpE=; b=KADkYfwNFeiH4NVoTtlJB12Xwku9bxtwNZgzNI60eHHaPZnNw4XumpucnTMvwN3hc0 yWGcfXdgqXyaYO6IAsSz+6dOVLrZrn/PLoiXLAZXIPkuDnZk/apKo2z+BOJhbdtXF4Gw QwSG0QWB+X8rwnxsKejLcyqhwUF7IUbOPF3ZZR/W4fTU7uuaanaytFCXFWEfoa1+ci1j v5PzQWZd2pl+hjqz9Sqtkq0rG8zOSlI9GRU5jmBek8bHMsYyad3rmXKJq+9t0EW52rv5 h10J1ujitDgGAsJ75PygQbF8rB3kOU7/sWecANRX50La/vKTDREi+aBJ2J7fc5U7EKEt S+1A== X-Gm-Message-State: AAQBX9dSnPEdAViOG4q9hvNTdpgeGEIHcg/O8tFEimpoAmFO7Y/m5Ezs ZdtUze2G7rrZoPuOU13u970PIFrJOvqcg18/HrysFmmSsvgMhaL5hr51M/YHNwoSa0nwoEcKjz3 N4//X8XMhXORANI2JPVrqPFHKQyJXigpuNYETX95px3GlE5KLjKSqHV5pBR7D6c5r3bNawqzP+A mRL1TCB+44gMC3RdRFvBe7dbvhe+hZ9gH/AdkN X-Google-Smtp-Source: AKy350bd99QEznsJqpUtegKelkGzKKXeAl5a+EIvK79JzuTnozQB/0lcmr6JHkqK8TJ17BW5irXeCA== X-Received: by 2002:a17:907:20aa:b0:931:9cd2:c214 with SMTP id pw10-20020a17090720aa00b009319cd2c214mr60116ejb.66.1680557171597; Mon, 03 Apr 2023 14:26:11 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-226-105.bb.vodafone.cz. [86.49.226.105]) by smtp.gmail.com with ESMTPSA id gh5-20020a170906e08500b009475bf82935sm5005283ejb.31.2023.04.03.14.26.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Apr 2023 14:26:10 -0700 (PDT) Message-ID: <27eb89fc-8fdd-2988-0959-0af1d6d7a12a@enterprisedb.com> Date: Mon, 3 Apr 2023 23:26:09 +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: <0115b682-58f0-ea43-9ecd-c37a4495812e@enterprisedb.com> <0022dd9e-a439-d72f-d09b-ec512c23949b@enterprisedb.com> <4029fe58-f661-7d8d-cbbb-b936a05531e2@enterprisedb.com> <2de3bcad-6da9-9022-bce5-fc0416351d6e@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/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. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company