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 1pacRe-0006ZB-NA for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2023 13:06:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pacRd-0000KR-FF for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2023 13:06:01 +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 1pacRd-0000KI-07 for pgsql-hackers@lists.postgresql.org; Fri, 10 Mar 2023 13:06:01 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pacRV-00081g-KX for pgsql-hackers@lists.postgresql.org; Fri, 10 Mar 2023 13:06:00 +0000 Received: by mail-il1-x12c.google.com with SMTP id i19so2832928ila.10 for ; Fri, 10 Mar 2023 05:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; t=1678453551; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Yx6/BlWAXZ6QaBCHgAsWS+ckWk/8JLaBdW4gyODKORo=; b=09RwxmKaiIJj306N7DbssRa3qK32sOTg0tmeqcNnT7D0RHRY6+JMcDcWcvTDrSCH8O 8kM5OMfYGOQRaQ/msa+bpPIUY8L6XuXHH+hEQLmwHJtxoqtxiRwa2VePEje21isId/20 WL2p5Ws1oQg8l23J3m5XhooMsc4//atNM86Q5+hwD/81Zh+4q0j9ejbwlbx12YIhg/Wd 1WMDzZofJg00ubf09L+0O/JTMfGfTkPDXACKi14Zc7GAgNYL07zDkirjX/JnyRHZuyM2 DE13PS3vt8FfS/YfIncxyJBLzawMNpYJpshv8AYNIcOuRRxoxNjEeMgLXvPpAOYTEPri MZPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678453551; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Yx6/BlWAXZ6QaBCHgAsWS+ckWk/8JLaBdW4gyODKORo=; b=wFoWVLXbM8bwo0XZzgMgM0jPR3qKJoe8+XmAEK6fPO7arTgcWdKStkhek6h0EZsMkQ aKv6MkVnVXjE8PGIk0+j/Lnt/NUmy9yUj26rpMjO5ZeeovQobbAw1XFNDVCTiXzquy6T +UawX63o9Npskc7ximBpBp801JiuqDJQPBH11/YKPysumbrBF9F9Q+bN+NbagL6yBp8P ZtKm9sQDo7mcv9a43hyigZ0vpIgBimg9CI95pXzCcSzB3QHJKs/r+cM/7DXzffl5vZw3 Y52Wo6CHPewygkhds7Zn71H58Rf9LFgkYj1iBs5Kqir+tnowgqdIpPTr3HY8AT0OLj8B ur9g== X-Gm-Message-State: AO0yUKXe3sAPgNr6wYWFdHqbxt8tk0TQSFsaLF/USHD1QhpCqOKYKjAG 2DKKK7fJA3eITGKuWsxhzxjOmw== X-Google-Smtp-Source: AK7set/AlYWx6/ydCjpEahHoW5mKyYvN0bW3MMa7kX48TqUYD311YBG7VLPcWYVCn/rLdt5ooqHgZg== X-Received: by 2002:a05:6e02:1d13:b0:317:9711:cf0 with SMTP id i19-20020a056e021d1300b0031797110cf0mr6876140ila.16.1678453551090; Fri, 10 Mar 2023 05:05:51 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id j10-20020a02cc6a000000b003a47dd62351sm641958jaq.144.2023.03.10.05.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:05:50 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 8A7D7800CC6; Fri, 10 Mar 2023 07:05:49 -0600 (CST) Date: Fri, 10 Mar 2023 07:05:49 -0600 From: Justin Pryzby To: Tomas Vondra Cc: gkokolatos@pm.me, Michael Paquier , shiy.fnst@fujitsu.com, pgsql-hackers@lists.postgresql.org, Rachel Heaton Subject: Re: Add LZ4 compression in pg_dump Message-ID: References: <8421f53d-c9f7-c02e-3278-9f9522a8e8f3@enterprisedb.com> <20230224015115.GS1653@telsasoft.com> <20230225050214.GH1653@telsasoft.com> <20230225140553.GI1653@telsasoft.com> <20230227044910.GO1653@telsasoft.com> <09b37949-cfe5-29bb-cbb1-498ee5700b61@enterprisedb.com> <2f680c4f-0944-5fd0-2e39-8cd95ccb89f5@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f680c4f-0944-5fd0-2e39-8cd95ccb89f5@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 09, 2023 at 06:58:20PM +0100, Tomas Vondra wrote: > I'm a bit confused about the lz4 vs. lz4f stuff, TBH. If we switch to > lz4f, doesn't that mean it (e.g. restore) won't work on systems that > only have older lz4 version? What would/should happen if we take backup > compressed with lz4f, an then try restoring it on an older system where > lz4 does not support lz4f? You seem to be thinking about LZ4F as a weird, new innovation I'm experimenting with, but compress_lz4.c already uses LZ4F for its "file" API. LZ4F is also what's written by the lz4 CLI tool, and I found that LZ4F has been included in the library for ~8 years: https://github.com/lz4/lz4/releases?page=2 r126 Dec 24, 2014 New : lz4frame API is now integrated into liblz4 > Maybe if lz4f format is incompatible with regular lz4, we should treat > it as a separate compression method 'lz4f'? > > I'm mostly afk until the end of the week, but I tried searching for lz4f > info - the results are not particularly enlightening, unfortunately. > > AFAICS this only applies to lz4f stuff. Or would the streaming mode be a > breaking change too? Streaming mode outputs the same format as the existing code, but gives better compression. We could (theoretically) change it in a bugfix release, and old output would still be restorable (I think new output would even be restorable with the old versions of pg_restore). But that's not true for LZ4F. The benefit there is that it avoids outputing a separate block for each row. That's essential for narrow tables, for which the block header currently being written has an overhead several times larger than the data. -- Justin