Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huOgK-0006lX-4D for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Aug 2019 22:08:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1huOgI-0002iy-8g for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Aug 2019 22:08:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huOgH-0002cS-QS for pgsql-hackers@lists.postgresql.org; Sun, 04 Aug 2019 22:08:45 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huOgD-00066a-WD for pgsql-hackers@postgresql.org; Sun, 04 Aug 2019 22:08:44 +0000 Received: by mail-wm1-x344.google.com with SMTP id 207so72932130wma.1 for ; Sun, 04 Aug 2019 15:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Vlih+nEsSZQqqWp3XcbH7VJ5/T2XrSfZ6IY0qKOv6O8=; b=JtlUh3lrBbM2xpYSGfJ/hrIgge0WVJXVPUjOsOIe6dZoIuYLX4QlU62ZGgdjA/ywtx bTmQJ7WdqKtSIHuNJBfluGRZEZhSIQR/fuKM99htZh/71hBx+FKR/SAMcTIL9/IfG0wo AatP8Qfg6+N+RJaPYgn36vLyaYi96v0hX0O8aiZ6jlYL2x/wgBKKFB8ibc4ZHI+UyWS6 qVHR4QJZ72OLQDZEbLihZN9EabhvLJcRJrmAGMFaOIbtiavnQPQNeBpNnX5+bSfc0yyJ U/XxwG8hWTj5iqkVi1qoubhlwMV04gARrXsBo4vcsTSyVFWs20OeTK+t1h4VvaeppdOs xnNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Vlih+nEsSZQqqWp3XcbH7VJ5/T2XrSfZ6IY0qKOv6O8=; b=o9R3KzivwZyON21BFqM1xTzi+EGby38zqGEnrSb4fujSUR8en27bdzSZn3zBdz/75p tOPSLnf4qe9hjQFyaQ3eSZv2kYFknWy1eeS9P9S59w9co+ncaRPmXd7uRMpje32qlh9A 8gU2vA5uJMX8HjaTl7TK2p53zE4MHqTuL/pTEHXdZ4kUnm75hOG0NzLTITNFlln20oC6 ibQUmfaBRsXzoGuRdaG8V/inQVK2SBy3hwsHdrKzigHwuI4z3GwTYysjf6BAds61wEnJ 4Ypz+d6J9ENKRPBloqcUvhVEfDPLTEydVB2OExEMHSFPP0IA0E9REHG9iASVff+J59Nx sG7Q== X-Gm-Message-State: APjAAAV+yffhs5w/NugOQwcaBdWss/FyhtqCjv90isu44+lLtT78uNLM /Hw5yCS959PE17RoF3XQGNeh6g== X-Google-Smtp-Source: APXvYqzFWBe4Snho+r1JmRyt+9AOmeOLTWk3112SA763qMS7kKpvjIMV1b9O7fYz6ZwCEs/XnJqukw== X-Received: by 2002:a1c:7414:: with SMTP id p20mr14309331wmc.145.1564956518436; Sun, 04 Aug 2019 15:08:38 -0700 (PDT) Received: from ?IPv6:2a02:8308:13b:9400:242f:19ac:a5a4:6296? ([2a02:8308:13b:9400:242f:19ac:a5a4:6296]) by smtp.gmail.com with ESMTPSA id r15sm87641362wrj.68.2019.08.04.15.08.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Aug 2019 15:08:37 -0700 (PDT) Subject: Re: pglz performance To: Andres Freund Cc: Tomas Vondra , Andrey Borodin , Konstantin Knizhnik , Michael Paquier , pgsql-hackers , Vladimir Leskov References: <20190802144345.d62jtiyyx6r2y73f@development> <20190802163948.i6mjypdgujeorrbi@alap3.anarazel.de> <20190802170039.o4pabnzm4xy3z7uj@development> <20190802171258.nob5zo2vu7siqo2b@alap3.anarazel.de> <20190802175239.5ds6rhdso6hwy4vk@development> <20190802182003.u477q6itwudieqxf@alap3.anarazel.de> <20190802194859.qxzxq2achzottkup@development> <20190804192034.smjcedlyjiusgtgg@alap3.anarazel.de> From: Petr Jelinek Message-ID: <4df61f6c-5800-30f0-7f84-cef4847e8a07@2ndquadrant.com> Date: Mon, 5 Aug 2019 00:08:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190804192034.smjcedlyjiusgtgg@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 04/08/2019 21:20, Andres Freund wrote: > On 2019-08-04 02:41:24 +0200, Petr Jelinek wrote: >> Same here. >> >> Just so that we don't idly talk, what do you think about the attached? > > Cool! > >> It: >> - adds new GUC compression_algorithm with possible values of pglz (default) >> and lz4 (if lz4 is compiled in), requires SIGHUP > > As Tomas remarked, I think it shouldn't be SIGHUP but USERSET. And I > think lz4 should be preferred, if available. I could see us using a > list style guc, so we could set it to lz4, pglz, and the first available > one would be used. > Sounds reasonable. >> - adds 1 byte header to the compressed data where we currently store the >> algorithm kind, that leaves us with 254 more to add :) (that's an extra >> overhead compared to the current state) > > Hm. Why do we need an additional byte? IIRC my patch added that only > for the case we would run out of space for compression formats without > extending any sizes? > Yeah your patch worked differently (I didn't actually use any code from it). The main reason why I add the byte is that I am storing the algorithm in the compressed value itself, not in varlena header. I was mainly trying to not have every caller care about storing and loading the compression algorithm. I also can't say I particularly like that hack in your patch. However if we'd want to have separate GUCs for TOAST and WAL then we'll have to do that anyway so maybe it does not matter anymore (we can't use similar hack there AFAICS though). > >> - changes the rawsize in TOAST header to 31 bits via bit packing >> - uses the extra bit to differentiate between old and new format > > Hm. Wouldn't it be easier to just use a different vartag for this? > That would only work for external TOAST pointers right? The compressed varlena can also be stored inline and potentially in index tuple. > >> - I expect my changes to configure.in are not the greatest as I don't have >> pretty much zero experience with autoconf > > FWIW the configure output changes are likely because you used a modified > version of autoconf. Unfortunately debian/ubuntu ship one with vendor > patches. > Yeah, Ubuntu here, that explains. -- Petr Jelinek 2ndQuadrant - PostgreSQL Solutions for the Enterprise https://www.2ndQuadrant.com/