Re: libpq compression (part 3)

Поиск
Список
Период
Сортировка
От Jacob Burroughs
Тема Re: libpq compression (part 3)
Дата
Msg-id CACzsqT5S4bAD7o5=X8+RHbwZcZzPipH6NG0Y953Yw5HZmVkeFw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: libpq compression (part 3)  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: libpq compression (part 3)  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, May 15, 2024 at 11:31 AM Robert Haas <robertmhaas@gmail.com> wrote:
> From my point of view, it's the client who knows what it wants to do
> with the connection. If the client plans to read a lot of data, it
> might want the server to compress that data, especially if it knows
> that it's on a slow link. If the client plans to send a lot of data --
> basically COPY, I'm not thinking this is going to matter much
> otherwise -- then it might want to compress that data before sending
> it, again, especially if it knows that it's on a slow link.
>
> But what does the server know, really? If some client connects and
> sends a SELECT query, the server can't guess whether that query is
> going to return 1 row or 100 million rows, so it has no idea of
> whether compression is likely to make sense or not. It is entitled to
> decide, as a matter of policy, that it's not willing to perform
> compression, either because of CPU consumption or security concerns or
> whatever, but it has no knowledge of what the purpose of this
> particular connection is.

I think I would agree with that.  That said, I don't think the client
should be in the business of specifying what configuration of the
compression algorithm the server should use.  The server administrator
(or really most of the time, the compression library developer's
defaults) gets to pick the compression/compute tradeoff for
compression that runs on the server (which I would imagine would be
the vast majority of it), and the client gets to pick those same
parameters for any compression that runs on the client machine
(probably indeed in practice only for large COPYs).  The *algorithm*
needs to actually be communicated/negotiated since different
client/server pairs may be built with support for different
compression libraries, but I think it is reasonable to say that the
side that actually has to do the computationally expensive part owns
the configuration of that part too.  Maybe I'm missing a good reason
that we want to allow clients to choose compression levels for the
server though?


--
Jacob Burroughs | Staff Software Engineer
E: jburroughs@instructure.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: GenBKI emits useless open;close for catalogs without rows
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: Adding the extension name to EData / log_line_prefix