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 1fhVCD-0001Z5-PG for pgsql-general@arkaria.postgresql.org; Mon, 23 Jul 2018 07:23:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fhVCB-0002iE-N7 for pgsql-general@arkaria.postgresql.org; Mon, 23 Jul 2018 07:23:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fhVCB-0002i7-6K for pgsql-general@lists.postgresql.org; Mon, 23 Jul 2018 07:23:51 +0000 Received: from mail-oi0-x242.google.com ([2607:f8b0:4003:c06::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fhVC8-0004PC-H4 for pgsql-general@lists.postgresql.org; Mon, 23 Jul 2018 07:23:49 +0000 Received: by mail-oi0-x242.google.com with SMTP id l10-v6so31523376oii.0 for ; Mon, 23 Jul 2018 00:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=LrTa4okL/HM5JImcSoZX5IIX8MMqWN+qzWDpX1lPLgU=; b=N64k35q8omKI0raiMyhfoBCDdkRNJQte0vMqt/iRqkIfhWKtZeaJUYNIo9zCE9E7XO bn4Yz5Gt33dpK9ramkXL6ROSpOzGQ9GPly529zlWdgi2fk27SRLPXXQeyBmTviCh3EAV dTEvEqvlFqDqhx1SQ4lMmDS0iwkrauXuHZ9xI+ByNu956a7EHC0vEg6QfB3s1aox4c/Q CCLIqHT7QN5C41pcFxZCX2er5ryArWgIZnNR4/YnbQZIA1pf65sgeRDcmW4/j6F/IfgY GRJm38niyt0eqjQlCSf/G2PGcFQBsd1lq+Kmaft74iQa7uTm2BSy9hTWx4cwbf26pJC6 6N0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=LrTa4okL/HM5JImcSoZX5IIX8MMqWN+qzWDpX1lPLgU=; b=OIcKC7uAK3DwhaOjI+qqG7xpJ2TEhedaoFG42ZrPQ8MXhGZDHOjgAA1krAZCXkIEnC m3wZh2NnUoXgbkPP8Ssx3L00mzV+UKx1BvQfPgO/iOrqkA30zsCegmf9IhmfrmNGHuXf 55F7NBGus1C4iCLBTdv26xuEGpqoY0h0U2i9YHIgWt4M3fxn4EFmeYiZRDCBlNCS2Rnc qxRFx28dXNv1h9MsAcLLFZrBu/XiIV7yUl1m8n+42DmJGjhUERNZWrrUFYGp2kGhmMki Qzox4oxGLSB6JRoLRnY4O+V4gYeZsg3uZBI1t8WQbO6FYKwwfC1ZtEnQS5ZYfy5735zp yGPQ== X-Gm-Message-State: AOUpUlHnUbpPYEZf4r7IqnKTtPCP3ukclSi42vpgVNXLBdvNIdLfau2z Nz2emtIXRKsg0CUPiX+R0P6vHNQgygE= X-Google-Smtp-Source: AAOMgpeGsOVCWJf/qedn4McfNWGQMPIW57RB35BPAyyCFi0WUofGPp+EJjGegN5RgCpf9Z9ErnayGA== X-Received: by 2002:aca:6749:: with SMTP id b9-v6mr7906324oiy.247.1532330627328; Mon, 23 Jul 2018 00:23:47 -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 f75-v6sm16099394oig.53.2018.07.23.00.23.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 00:23:46 -0700 (PDT) To: pgsql-general@lists.postgresql.org From: Ron Subject: Improving pg_dump performance Message-ID: Date: Mon, 23 Jul 2018 02:23:45 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, We've got an old (v8.4.17, thus no parallel backups) 2.9TB database that needs to be migrated to a new data center and then restored to v9.6.9. The database has many large tables full of bytea columns containing pdf images, and so the dump file is going to be more than 2x larger than the existing data/base... The command is: $ pg_dump -v -Z0 -Fc $DB --file=${TARGET}/${DATE}_${DB}.dump 2> ${DATE}_${DB}.log Using -Z0 because pdf files are already compressed. Because of an intricate web of FK constraints and partitioned tables, the customer doesn't trust a set of "partitioned" backups using --table= and regular expressions (the names of those big tables all have the year in them), and so am stuck with a single-threaded backup. Are there any config file elements that I can tweak (extra points for not having to restart postgres) to make it run faster, or deeper knowledge of how pg_restore works so that I could convince them to let me do the partitioned backups? Lastly, is there any way to not make the backups so large (maybe by using the --binary-upgrade option, even though the man page says, "in-place upgrades only")? -- Angular momentum makes the world go 'round.