Re: libpq compression

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: "Iwata, Aya" <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "rharwood(at)redhat(dot)com" <rharwood(at)redhat(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, "g(dot)smolkin(at)postgrespro(dot)ru" <g(dot)smolkin(at)postgrespro(dot)ru>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Subject: Re: libpq compression
Date: 2019-02-08 16:33:53
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 08.02.2019 12:33, Daniel Gustafsson wrote:
>> On 8 Feb 2019, at 10:15, Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru> wrote:
>> Frankly speaking, I do not think that such flexibility in choosing compression algorithms is really needed.
>> I do not expect that there will be many situations where old client has to communicate with new server or visa versa.
>> In most cases both client and server belongs to the same postgres distributive and so implements the same compression algorithm.
>> As far as we are compressing only temporary data (traffic), the problem of providing backward compatibility seems to be not so important.
> I don’t think this assumption is entirely valid, and would risk unnecessary
> breakage.

I am also not sure in this assumption. We (PostgresPro) are having some
issues now with CFS (file level compression of Postgres database).
Some build are using zstd, some are using zlib (default)...
zstd is faster and provides better compression ratio and is available at
most platforms.
But zlib is available almost everywhere and is used by Postgres by
The only thing I know for sure: if we implement several algorithms and
make it possible for database user to make a choice, then
we will get much more problems.

Right now Postgres is using zlib as the only supported compression
algorithm in many places.
So may be libpq compression should also use only zlib and provide no
other choices?

Concerning backward compatibility. Assume that we allow use zstd, but
then Facebook change zstd license or some critical bug in it is found.
So we will have to exclude dependency on zstd. So there will be no
backward compatibility in any case, even if we support more
sophisticated negotiation between client and server in choosing
compression algorithm.

What can be more interesting - is to support custom compression
algorithms (optimized for the particular data flow).
But it seems to be completely different and much more sophisticated
story. We have to provide some mechanism for loading foreign libraries
at client side!
IMHO it is overkill.

Konstantin Knizhnik
Postgres Professional:
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message s.cherkashin 2019-02-08 17:16:15 Re: Add client connection check during the execution of the query
Previous Message Ashutosh Sharma 2019-02-08 16:27:14 Re: ON SELECT rule on a table without columns