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 1oVBkV-0008GV-HM for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Sep 2022 13:02:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oVBkU-0000vq-4Z for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Sep 2022 13:02:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oVBkT-0000sf-Qt for pgsql-hackers@lists.postgresql.org; Mon, 05 Sep 2022 13:02:45 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oVBkM-0004YH-F0 for pgsql-hackers@postgresql.org; Mon, 05 Sep 2022 13:02:44 +0000 Received: by mail-io1-xd2e.google.com with SMTP id c4so6791529iof.3 for ; Mon, 05 Sep 2022 06:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=RYPB3z/IOlyBknYjY0+fiIquPfzjdPkFAE915yDV3Ls=; b=ICBNpCnExfnciFCxrN6tc1zZWB3LrkRy1Ej5P4S8H4ytK5tt13YF2ZiGIFNIh7v8AM pISxNW9AUShGTDfHcLIBRBtxWl4zFEXzzpSzNudmx9UX6D4oRxmsIXEwfXxKv4a322eS 4LXqOeNzor3OK8oil4UKUr7ULlQfO/HC/ETZ2LbrIYvW+QI2IxWH+Iog+BQMu9qr9A1E tjzq8dxmPRs7DcAmTugPKTbjlOFaPk4axtrfLEb1vRgnud4wdTo3diD5+LK006EogCZF dDPf89LHsG21vIrH+kD+5uX7rlxnFnukGKF9qMB1H0+w7q9LD2O5wnm6mSPLfzReuM6E omlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=RYPB3z/IOlyBknYjY0+fiIquPfzjdPkFAE915yDV3Ls=; b=XPWzdCRNc0tK3lX4rhtKoqgEQAoRs2/hSE25dPjCW1qhcCtKsnX/pIZcvoh954Yyvi qT4eAKXFIs2Bmw7AYF5l3D9G7EsiWrxJ04JxgchVWswXiD35gYX16nXLHY84uiCj83f9 AfRQF4SGTagzc5T7yZw0d6DD8xQAmRaw9Mugt8ObM3IrtE+B0u9v/NWbApQLLb6laUiy jwzF+J+b8K3ndnZ9J8vH2d1/wI4M8vQM79qdETXpXtw9D3ptLOgVKeQuFB0sw9Mt+K57 gvH654BSb+CTRxi4glPLVwsoP/Nf+u3ICETDI1Jd51MqXeyuWiS0qwJOFdcuAE0GQ1AF w3Xg== X-Gm-Message-State: ACgBeo0JcCjej8lzXo6/i9+hbRlcIfPIvH/dQzczum64jrFJyBGTytVg mM0dXcZBdPzzertBl+ML8thgzk1hYgGEIw== X-Google-Smtp-Source: AA6agR4nOdIO9kXTwKqLyxZO7dLb/yWKaxjcXQdLrgAJmGiOjFdwsnJj84zkn2DmKHRcldcEtNPGrg== X-Received: by 2002:a05:6638:1492:b0:34c:d42:ac2f with SMTP id j18-20020a056638149200b0034c0d42ac2fmr13335736jak.305.1662382957493; Mon, 05 Sep 2022 06:02:37 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id d188-20020a0262c5000000b00349be675e76sm3989947jac.131.2022.09.05.06.02.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Sep 2022 06:02:36 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id B40F4801058; Mon, 5 Sep 2022 08:02:35 -0500 (CDT) Date: Mon, 5 Sep 2022 08:02:35 -0500 From: Justin Pryzby To: Matthias van de Meent Cc: pgsql-hackers@postgresql.org Subject: Re: Different compression methods for FPI Message-ID: <20220905130235.GJ31833@telsasoft.com> References: <20210519030618.GS373@telsasoft.com> <20210525044444.GV3676@telsasoft.com> <3252174C-C21D-4711-A038-5230DE465BAE@yandex-team.ru> <20210614012412.GA31772@telsasoft.com> <20220902115511.GY31833@telsasoft.com> <20220905002320.GD31833@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Sep 05, 2022 at 02:45:57PM +0200, Matthias van de Meent wrote: > Hi, > > I have a small question for those involved: I suggest to "reply all" > Context: I'm trying to get the smallest BKPIMAGE size possible > regardless of CPU cost, which means I'm trying multiple compressions > to get the smallest data possible with the options available. This > means ignoring the wal_compression GUC in XLogCompressBackupBlock and > brute-forcing the smallest compression available, potentially layering > compression methods, and returning the bimg_info compression flags > that will be stored in XLogCompressBackupBlock and used to decompress > the block's data. I think once you apply one compression method/algorithm, you shouldn't expect other "layered" methods to be able to compress it at all. I think you'll get better compression by using a higher compression level in zstd (or zlib) than with any combination of methods. A patch for configurable compression level was here: https://postgr.es/m/20220222231948.GJ9008@telsasoft.com > Is there a prescribed order of compression algorithms to apply when > (de)compressing full page images in WAL, when the bimg_info has more > than one BKPIMAGE_COMPRESS_*-flags set? That is, when I want to check > the compression of the block image with both ZSTD and LZ4, which order > is the ordering indicated by bimg_info = (COMPRESS_LZ4 | > COMPRESS_ZSTD)? There's currently a separate bit for each method, but it's not supported to "stack" them (See also the "Save bits" patch, above). This came up before when Greg asked about it. https://www.postgresql.org/message-id/20210622031358.GF29179@telsasoft.com https://www.postgresql.org/message-id/20220131222800.GY23027@telsasoft.com -- Justin