Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 5A1759FE16B for ; Thu, 14 Jun 2012 15:43:22 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SfF0n-0001WD-6l for pgsql-hackers@postgresql.org; Thu, 14 Jun 2012 18:43:21 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5EIh4vq011504; Thu, 14 Jun 2012 14:43:04 -0400 (EDT) From: Tom Lane To: Euler Taveira cc: Pgsql Hackers Subject: Re: libpq compression In-reply-to: <4FD9E70B.9040607@timbira.com> References: <4FD9698F.2090407@timbira.com> <29853.1339651170@sss.pgh.pa.us> <4FD9E70B.9040607@timbira.com> Comments: In-reply-to Euler Taveira message dated "Thu, 14 Jun 2012 10:28:43 -0300" Date: Thu, 14 Jun 2012 14:43:04 -0400 Message-ID: <11502.1339699384@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/668 X-Sequence-Number: 209508 Euler Taveira writes: > On 14-06-2012 02:19, Tom Lane wrote: >> ... I especially think that importing bzip2 >> is a pretty bad idea --- it's not only a new dependency, but bzip2's >> compression versus speed tradeoff is entirely inappropriate for this >> use-case. > I see, the idea is that bzip2 would be a compiled-in option (not enabled by > default) just to give another compression option. I'm not particularly thrilled with "let's have more compression options just to have options". Each such option you add is another source of fail-to-connect incompatibilities (when either the client or the server doesn't have it). Moreover, while there are a lot of compression algorithms out there, a lot of them are completely unsuited for this use-case. If memory serves, bzip2 for example requires fairly large data blocks in order to get decent compression, which means you are either going to get terrible compression or suffer very bad latency when trying to apply it to a connection data stream. So I've got very little patience with the idea of "let's put in some hooks and then great things will happen". It would be far better all around if we supported exactly one, well-chosen, method. But really I still don't see a reason not to let openssl do it for us. regards, tom lane