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 1lszxy-0008MW-Qb for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jun 2021 03:42: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 1lszxw-00046v-JH for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jun 2021 03:42:16 +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 1lszxw-00046n-94 for pgsql-hackers@lists.postgresql.org; Tue, 15 Jun 2021 03:42:16 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lszxp-0007NV-Le for pgsql-hackers@postgresql.org; Tue, 15 Jun 2021 03:42:15 +0000 Received: by mail-io1-xd2f.google.com with SMTP id l64so20266390ioa.7 for ; Mon, 14 Jun 2021 20:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jhUlDN1HoY26ISW54dsYzLhujb2vLvx7PsalvhhrjzA=; b=uQITL4ft61slKy00u9CsaCGgXdlxntN+5+sjV8eLsap9i+V+s5wE4QZf/GOCNd29ru RefJeIG1uRIy9Jtln3F8JfWsfjZ9nz9Xr84m7gTjneUIz3rBeUoL34dXbloe0LhE1LCd r0/cC7IiS5spgcdngq3D0I1NriVRnmol5nENAOUxXhizdYYu2ILDqi9VHFbT4Hc2PoHM cDiX3A88UzrQMF75aMY1tQcv9G5ICXpRRSr5A2RehbT1f9W7w8L2c3hZVav21Rh9NRIx QWlysDswYwDMsucNJIi4v4doZ7JZU7oe9d4Jow0BOHzUBkb79mLbMz2lnU4neE4SqFqw uKrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jhUlDN1HoY26ISW54dsYzLhujb2vLvx7PsalvhhrjzA=; b=RHt9QcxxNOPT7p7WpaMHn6RML5FnVAtFagD1T5lGKv9vRoL+gsgKGlWlOvhDaqFuAB 4Ox70jq75S+uQ2uDXJQilwsDhH3CFM3RDjtRNCo7Ik7ZIXT2h1tXzrywUtS8VTNl84Ri Nls4BJVCcQXjDNuXY3RQGH3t1hFBPkcBbz6gMfWldQooXqjSku+JmkomELJ0bhaWnJlk B/j8ce9DwZcVlUVhwNuP9090116GWBJ1ec1vv/kk2C5NdYFOba66oOIuuCiSdRh0F+vz wgkS5Kustm4OVF7c3jdXwaQwpSTn4hfd/pRCAfNPz39iAbnR+bBqbdoztX81KzZVmn89 I7kw== X-Gm-Message-State: AOAM530TE6WX5XfofIhvh2HJrc4sDYbv4sKgat8elYW96ea2NCD3R1pS Iv3OIKKI4sV9Q4/aX3qyZk/Eag== X-Google-Smtp-Source: ABdhPJwJG6Hs7BS8eDqsT8yTsgU53R5d2//C1J+MIKX/2dIlYmgDTBVh0Qy8mSbT0/Nhv0NOeR/6rg== X-Received: by 2002:a6b:661a:: with SMTP id a26mr7316398ioc.102.1623728528739; Mon, 14 Jun 2021 20:42:08 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id c11sm8699986ils.24.2021.06.14.20.42.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jun 2021 20:42:08 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 124E7800AE5; Mon, 14 Jun 2021 22:42:07 -0500 (CDT) Date: Mon, 14 Jun 2021 22:42:06 -0500 From: Justin Pryzby To: Michael Paquier Cc: Andrey Borodin , pgsql-hackers@postgresql.org, Thomas Munro , Peter Geoghegan , Andres Freund Subject: Re: Different compression methods for FPI Message-ID: <20210615034206.GL31772@telsasoft.com> References: <20210519030618.GS373@telsasoft.com> <20210525044444.GV3676@telsasoft.com> <3252174C-C21D-4711-A038-5230DE465BAE@yandex-team.ru> <20210614012412.GA31772@telsasoft.com> <20210615014208.GK31772@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 Tue, Jun 15, 2021 at 11:39:24AM +0900, Michael Paquier wrote: > On Mon, Jun 14, 2021 at 08:42:08PM -0500, Justin Pryzby wrote: >>>> It's USERSET following your own suggestion (which is a good suggestion): > >> + {"wal_compression_method", PGC_SIGHUP, WAL_SETTINGS, > >> + gettext_noop("Set the method used to compress full page images in the WAL."), > >> + NULL > >> + }, > >> + &wal_compression_method, > >> + WAL_COMPRESSION_PGLZ, wal_compression_options, > >> + NULL, NULL, NULL > >> Any reason to not make that user-settable? If you merge that with > >> wal_compression, that's not an issue. > > Hmm, yeah. This can be read as using PGC_USERSET. With the second > part of my sentence, I think that I imply to use PGC_SUSET and be > consistent with wal_compression, but I don't recall my mood from one > month ago :) Sorry for the confusion. Hold on - we're all confused (and I'm to blame). The patch is changing the existing wal_compression GUC, rather than adding wal_compression_method. It's still SUSET, but in earlier messages, I called it USERSET, twice. > You cannot do cross-checks for GUCs in their assign hooks or even rely > in the order of those parameters, but you can do that in some backend > code paths. A recent discussion on the matter is for example what led > to 79dfa8a for the GUCs controlling the min/max SSL protocols > allowed. Thank you - this is what I was remembering. > > The goal of the patch is to give options, and the overhead of adding both zlib > > and lz4 is low. zlib gives good compression at some CPUcost and may be > > preferable for (some) DWs, and lz4 is almost certainly better (than pglz) for > > OLTPs. > > Anything will be better than pglz. I am rather confident in that. > > What I am wondering is if we need to eat more bits than necessary for > the WAL record format, because we will end up supporting it until the > end of times. Why ? This is WAL, not table data. WAL depends on the major version, so I think wal_compression could provide a different set of compression methods at every major release? Actually, I was just thinking that default yes/no/on/off stuff maybe should be defined to mean "lz4" rather than meaning pglz for "backwards compatibility". > hear here, there are many cases that we may care about depending on > how much CPU one is ready to pay in order to get more compression, > knowing that there are no magic solutions for something that's cheap > in CPU with a very good compression ratio or we could just go with > that. So it seems to me that there is still an argument for adding > only one new compression method with a good range of levels, able to > support the range of cases we'd care about: > - High compression ratio but high CPU cost. > - Low compression ratio but low CPU cost. I think zlib is too expensive and lz4 doesn't get enough compression, so neither supports both cases. In a sample of 1, zlib-1 is ~35% slower than lz4 and writes half as much. I think zstd could support both cases; however, I still see it as this patch's job to provide options, rather to definitively conclude which compression algorithm is going to work best for everyone's use data and application. -- Justin