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 1n4LKm-0001AK-VX for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jan 2022 11:17:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n4LKl-0003fY-Oc for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jan 2022 11:16:59 +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 1n4LKl-0003fP-Ff for pgsql-hackers@lists.postgresql.org; Mon, 03 Jan 2022 11:16:59 +0000 Received: from forwardcorp1p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b6:217]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4LKj-0001eB-P0 for pgsql-hackers@lists.postgresql.org; Mon, 03 Jan 2022 11:16:59 +0000 Received: from iva8-c5ee4261001e.qloud-c.yandex.net (iva8-c5ee4261001e.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:a8a6:0:640:c5ee:4261]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id D3C482E09DD; Mon, 3 Jan 2022 14:16:55 +0300 (MSK) Received: from 2a02:6b8:c0c:1086:0:640:dc79:83bf (2a02:6b8:c0c:1086:0:640:dc79:83bf [2a02:6b8:c0c:1086:0:640:dc79:83bf]) by iva8-c5ee4261001e.qloud-c.yandex.net (mxbackcorp/Yandex) with HTTP id rGPUnx0MhuQ1-GtMaVUmb; Mon, 03 Jan 2022 14:16:55 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1641208615; bh=my0dKsmUuLcFljW72RIhtxzqAOf8Q34DZI75Z25sIlo=; h=References:Date:Message-Id:Cc:Subject:In-Reply-To:To:From; b=eFd9U04CIJfaYPmkEUHLhiW8I/Pjcyzxl1ZrktJ4AWnpQ9h6lNAXranMAaawuWdLz R2Wzhgb5mxpBZ3cU81zsumepXeeukYfLsRTvmA1Nk8c7RnzdqTZYRGM9QTvRFxvDWB bIepYMEG8kpA4ZnM+h8C0+7eVWilS6D3rgGBrfrs= Authentication-Results: iva8-c5ee4261001e.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru Received: by iva8-dc7983bf477b.qloud-c.yandex.net with HTTP; Mon, 03 Jan 2022 14:16:55 +0300 From: Andrey Borodin To: Justin Pryzby Cc: pgsql-hackers@lists.postgresql.org, Daniil Zakhlystov In-Reply-To: <20220101172504.GW24477@telsasoft.com> References: <20220101172504.GW24477@telsasoft.com> Subject: Re: libpq compression (part 2) MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 03 Jan 2022 16:16:55 +0500 Message-Id: <540991641208615@iva8-dc7983bf477b.qloud-c.yandex.net> Content-Transfer-Encoding: 7bit Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Maybe you should reset the streams between each compression message (even if > it's using the same compression algorithm). This might allow better > compression. AFAIK on the contrary - longer data sequence usually compresses better. The codec can use knowledge about prior data to better compress current bytes. Best regards, Andrey Borodin.