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 1pryLT-0006CB-SI for pgsql-general@arkaria.postgresql.org; Thu, 27 Apr 2023 09:55:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pryLS-0006Dw-PD for pgsql-general@arkaria.postgresql.org; Thu, 27 Apr 2023 09:55:22 +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 1pryLS-0006Dn-En for pgsql-general@lists.postgresql.org; Thu, 27 Apr 2023 09:55:22 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pryLP-0029d9-Vg for pgsql-general@lists.postgresql.org; Thu, 27 Apr 2023 09:55:21 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5067736607fso14363882a12.0 for ; Thu, 27 Apr 2023 02:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1682589317; x=1685181317; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=PQfzn79YeggN9kbXu6ZXglgsOxSy/rAdafFi5eigR30=; b=Pgpioy268FsmrI4nBzaazyVoD8Dzg6KuqNrv9f5jk1uYoSC+ETe6IRanGRA2gwHlRW eulciRSwMzqKeL1q5Ftq0t1/ZLYX1oJCCbuPQ90eAQKvWAobF897zqDbWVkHTkB+hhpy wdLyzjAnP4q0M1IkolEZlNfPTJf6xpdhHbkFhF/SucW90BKjz+O8wApQlWlysWDnLEf/ KnCPMO3M4cbDuAx1C0rXtpJD1nX+YAx8mKLtKtl7e/SiUr3Aq8gKl6uSQxQm7hWN5Ib2 saF1RZ27P9uLuIdjicqPeDzN1ebfGCO3zVtxaQ6ZXWN5ffmEzwY3iVD6p6DScXdCbh0v fU3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682589317; x=1685181317; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PQfzn79YeggN9kbXu6ZXglgsOxSy/rAdafFi5eigR30=; b=haO/s3R4G/2pqWZyWu6VKL8/QG3FcRa3QtCjNR+TarM23m8AsS1BpdcwBHO8sW/a7H hEb8ZQgidyuwBezO6aU/+S+A9yykezUg9rZNJvNsA3KqnE+8zh0L9Ok6C5+Rr7p5cd/Z mNsrn1pes+7hADfk9bT4d95X/7Bda+RcKogda+8eM7wRFnbB5AT4HPo2yUieHXhc60Ch XvqOBWiiuO2ZuK+X0cUdgF6tMoYsqBiE4tHT/6X4x/a6RYG0Cxl44MR6RVf0Md4hj5qu yeZX2hZP24ug2bII+EGfjpL93cihOWPtbM+ynoDGAUxzGgIjea04zDi3xYRBifjsLtq0 i/rw== X-Gm-Message-State: AC+VfDyxDyRDtgOLtaE+lHSFCVzREaQhL/fyI9zXOPiewbpjEMrOAJha 8svHtaenp2SloH0RqdG96WHG5Q== X-Google-Smtp-Source: ACHHUZ5BsisTUz15jm0OXg93EPOjMYK71+uI/8XqqfWZjW4fobDtf8vyAzmnWTr4GqfYDoNCiVriMA== X-Received: by 2002:a05:6402:2029:b0:509:f31f:b570 with SMTP id ay9-20020a056402202900b00509f31fb570mr1191536edb.23.1682589317212; Thu, 27 Apr 2023 02:55:17 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:387b:5a4:e99:4794:568d]) by smtp.gmail.com with ESMTPSA id n7-20020aa7c787000000b00506b2af49fbsm7796623eds.81.2023.04.27.02.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 02:55:16 -0700 (PDT) Message-ID: <5be87a471484600306d4e4922a6587fc9a6bf3b7.camel@cybertec.at> Subject: Re: PostgreSQL in-transit compression for a client connection From: Laurenz Albe To: Dominique Devienne , Tushar Takate , daniel@yesql.se Cc: pgsql-general@lists.postgresql.org Date: Thu, 27 Apr 2023 11:55:15 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2023-04-27 at 11:44 +0200, Dominique Devienne wrote: > as someone who must store ZLIB (from ZIP files) > and sometimes LZ4 compressed `bytea` values, I often find it's a shame th= at I have > to decompress them, send them over the wire uncompressed, to have the Pos= tgreSQL > backend recompress them when TOAST'ed. That's a waste of CPU and IO bandw= idth... That's not what you were looking for, but why not store the compressed data in the database (after SET STORAGE EXTERNAL on the column) and uncompress them after you have received them on the client side? Yours, Laurenz Albe