Re: [PATCH] COPY .. COMPRESSED

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: [PATCH] COPY .. COMPRESSED
Дата
Msg-id 20130115160845.GR16126@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: [PATCH] COPY .. COMPRESSED  (Claudio Freire <klaussfreire@gmail.com>)
Ответы Re: [PATCH] COPY .. COMPRESSED  (Claudio Freire <klaussfreire@gmail.com>)
Список pgsql-hackers
* Claudio Freire (klaussfreire@gmail.com) wrote:
> Postgres' packetized protocol lends itself quite well for this kind of
> thing. It could even be done on a packet-by-packet basis. The only
> drawback I see, is that it pretty much rules out piping through
> arbitrary commands (a protocol needs to be very clearly defined).

Actually, wouldn't PG's packet-based protocol be exactly the wrong way
to do any kind of good on-the-wire compression?  You certainly wouldn't
want to waste time compressing small packets, such as a single INSERT
command or similar, as you'll always have to send a packet out anyway.
Even doing it at the protocol level with something ssl-like, where
you wrap the entire connection, wouldn't help if the client has a
process along the lines of:

send INSERT command
wait for response
send INSERT command
wait for response
..
..

Since you'd still have to flush after each small bit of data.

Where it does work well is when you move into a bulk-data mode (ala
COPY) and can compress relatively large amounts of data into a smaller
number of full-size packets to be sent.
Thanks,
    Stephen

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_ctl idempotent option
Следующее
От: Tom Lane
Дата:
Сообщение: Re: logical changeset generation v4