Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fF33Y-0001tD-Fd for pgsql-general@arkaria.postgresql.org; Sat, 05 May 2018 19:41:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fF33U-0002DR-Ci for pgsql-general@arkaria.postgresql.org; Sat, 05 May 2018 19:41:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fF33U-0002DH-2W for pgsql-general@lists.postgresql.org; Sat, 05 May 2018 19:41:16 +0000 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fF33L-0001dF-W4 for pgsql-general@postgresql.org; Sat, 05 May 2018 19:41:15 +0000 Received: by mail-oi0-x241.google.com with SMTP id k17-v6so22002906oih.5 for ; Sat, 05 May 2018 12:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=WOch6E6eV3+2SkzxVfYeMxGaubv1F74mhnUHEH1BvAQ=; b=QqZguKZtYoRxXqQj5hMRVA2Pb+gU7P9qYqlmky857jiMRGzPg+r83MjFSnxGCAllDH 3SwMRz98wnPwyQJw9WKrc3/3oOp5D6ipXLrCBeFdmdc36pW1bM6f5ggnM6cGcSfuZZK8 hDkist2h2RC4HKMqNwu7t5tj2F066WA6zmG5f4jjIdBf0g2E2UybXA+DcOVquNYgkDKW 15CuFUG3g0i/JFwnq67jse8AOssVJsENlZpCB7MEu+y7HUxrrLhdtEF0H5FScE9uESKP jOE/qY6K5o9zmU1YdCfBzcO4fw6c39f5+lQ7I3k7tkV2wg1TWziBQYOJCmN/2wwtV3zb FVag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=WOch6E6eV3+2SkzxVfYeMxGaubv1F74mhnUHEH1BvAQ=; b=elEVJwNlc5EGSTYU/CuCysyivS/b3516IDMQUnkUel1K1wv/F87wNXV9PaBrf7hOad 1OLYAcO0mHu0JF4+Hv+XXyhosl0qkDwWQrthAXr7fz6ZBjOBwSdKK2K1348xuiI7CO+b 0kTAMAaqNi1D6cW0NmrJeLsvdtuTq+ku0KXCp6PMhInojOY1oc3v5FS8ZU+IfAAw80n0 YBkvzoPI/izlT6g7xywt/O2AlB0lEWc8VGR22OJHXtLDpQ4h8V9id4HBsbLs9oilC5zG 881jTvY4qJynPhAATVFWFT0bt8ffwPIvwWvKHCQWtj3+5e+uFOREgzKb5dK1Fq7lxSn+ is6g== X-Gm-Message-State: ALQs6tC1hk3f+jAJPISMsON16SySWDoIGMOteG9q58g/XdlTRliZDVdQ Y8hEKQtvluConBUwJm4PYdlvBg== X-Google-Smtp-Source: AB8JxZohzIaqYe63zsLSjB3/qTtHcv3YiyuBosaHyUgcL/84pSJWo4EVSGrORwH/qbEKUrN2Ph8HGg== X-Received: by 2002:aca:5086:: with SMTP id e128-v6mr21248662oib.315.1525549265005; Sat, 05 May 2018 12:41:05 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id h125-v6sm7379076oic.54.2018.05.05.12.41.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 May 2018 12:41:04 -0700 (PDT) Subject: Re: pg_dump with compressible and non-compressible tables To: Adrian Klaver , pgsql-general@postgresql.org References: <235eb14a-c215-9a57-9e4d-adefef8fc0c1@gmail.com> From: Ron Message-ID: <860a2838-1297-f52c-2346-385774243020@gmail.com> Date: Sat, 5 May 2018 14:41:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------E1B7EC790553AF50417230EB" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------E1B7EC790553AF50417230EB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 05/05/2018 12:13 PM, Adrian Klaver wrote: > On 05/05/2018 07:14 AM, Ron wrote: >> Hi, >> >> v9.6 >> >> We've got big databases where some of the tables are highly compressible, >> but some have many bytea fields containing PDF files. > > Can you see a demonstrable difference? Very much so.  The ASCII hex representations of the PDF files are compressible, but take a *long* time to compress. Uncompressed backups are 50% faster. >> >> When the data format is custom, directory or tar, how feasible would a >> "--no-blob-compression" option be (where pg_dump just tells the zlib >> library to just Store tables with bytea columns, while compressing all >> other tables at the specified -Z level)? > > In pg_dump blob refers to large objects: > > https://www.postgresql.org/docs/10/static/app-pgdump.html > " > -b > --blobs > >     Include large objects in the dump. This is the default behavior except > when --schema, --table, or --schema-only is specified. The -b switch is > therefore only useful to add large objects to dumps where a specific > schema or table has been requested. Note that blobs are considered data > and therefore will be included when --data-only is used, but not when > --schema-only is. > " > > These are different critters then bytea. Ok.  I need the data in my backups anyway, so excluding them is 100% contrary to what I need. -- Angular momentum makes the world go 'round. --------------E1B7EC790553AF50417230EB Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 05/05/2018 12:13 PM, Adrian Klaver wrote:
On 05/05/2018 07:14 AM, Ron wrote:
Hi,

v9.6

We've got big databases where some of the tables are highly compressible, but some have many bytea fields containing PDF files.

Can you see a demonstrable difference?

Very much so.  The ASCII hex representations of the PDF files are compressible, but take a long time to compress.  Uncompressed backups are 50% faster.


When the data format is custom, directory or tar, how feasible would a "--no-blob-compression" option be (where pg_dump just tells the zlib library to just Store tables with bytea columns, while compressing all other tables at the specified -Z level)?

In pg_dump blob refers to large objects:

https://www.postgresql.org/docs/10/static/app-pgdump.html
"
-b
--blobs

    Include large objects in the dump. This is the default behavior except when --schema, --table, or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.
"

These are different critters then bytea.

Ok.  I need the data in my backups anyway, so excluding them is 100% contrary to what I need.

--
Angular momentum makes the world go 'round.
--------------E1B7EC790553AF50417230EB--