Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvsNC-00062V-Kf for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 19:12:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvsNB-0001HP-Jj for pgsql-bugs@arkaria.postgresql.org; Fri, 22 May 2015 19:12:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YvpXO-00007g-GG for pgsql-bugs@postgresql.org; Fri, 22 May 2015 16:11:06 +0000 Received: from mail.atikon.at ([81.19.152.34]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YvpXJ-0002Rt-Gi for pgsql-bugs@postgresql.org; Fri, 22 May 2015 16:11:04 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.atikon.at (Postfix) with ESMTP id 19BF4102DD3 for ; Fri, 22 May 2015 18:10:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at atikon.com Received: from mail.atikon.at ([81.19.152.34]) by localhost (smithers.atikon.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3LPoTXpDQpq5 for ; Fri, 22 May 2015 18:10:53 +0200 (CEST) Received: from sphinx.localnet (cpe90-146-183-190.liwest.at [90.146.183.190]) (Authenticated sender: nine@atikon.com) by mail.atikon.at (Postfix) with ESMTPSA id DF026101E33 for ; Fri, 22 May 2015 18:10:53 +0200 (CEST) From: Stefan Seifert To: pgsql-bugs@postgresql.org Subject: pg_upgrade slowness for databases with many tables Date: Fri, 22 May 2015 18:10:53 +0200 Message-ID: <3559239.xQRrTQ2jGQ@sphinx> User-Agent: KMail/4.14.8 (Linux/4.1.0-rc4-1.g9c4ab6c-desktop; KDE/4.14.8; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, upgrading a database containing > 90000 tables and about the same number of views and indexes with pg_upgrade takes several hours. I've started the upgrade more than five hours ago and the "Creating dump of database schemas" step is still not finished. ps xaf output: 60709 pts/10 S+ 0:00 | \_ sudo -u postgres pg_upgrade -d /var/lib/pgsql/data.intern -D /var/lib/pgsql/data -b /usr/lib/postgresql92/bin -B /usr/lib/postgresql94/bin -j12 -k 60710 pts/10 S+ 0:00 | \_ pg_upgrade -d /var/lib/pgsql/data.intern -D /var/lib/pgsql/data -b /usr/lib/postgresql92/bin -B /usr/lib/postgresql94/bin -j12 -k 60806 pts/10 S+ 0:00 | \_ pg_upgrade -d /var/lib/pgsql/data.intern -D /var/lib/pgsql/data -b /usr/lib/postgresql92/bin -B /usr/lib/postgresql94/bin -j12 -k 60809 pts/10 S+ 0:00 | \_ sh -c "/usr/lib/postgresql94/bin/pg_dump" --host "/data/pgsql" --port 50432 -- username "postgres" --schema-only --quote-all-identifiers --binary-upgrade -- format=custom --file="pg_upgrade_dump_16428.custom" "zms" >> "pg_upgrade_dump_16428.log" 2>&1 60815 pts/10 S+ 3:52 | \_ /usr/lib/postgresql94/bin/pg_dump --host /data/pgsql --port 50432 --username postgres --schema-only --quote-all-identifiers --binary-upgrade -- format=custom --file=pg_upgrade_dump_16428.custom zms 60719 pts/10 S+ 0:00 /usr/lib/postgresql92/bin/postgres -D /var/lib/pgsql/data.intern -p 50432 -b -c listen_addresses= -c unix_socket_permissions=0700 -c unix_socket_directory=/data/pgsql 60720 ? Ss 0:00 \_ postgres: logger process 60722 ? Ss 0:00 \_ postgres: checkpointer process 60723 ? Ss 0:08 \_ postgres: writer process 60724 ? Ss 0:00 \_ postgres: wal writer process 60725 ? Ss 0:04 \_ postgres: stats collector process 60817 ? Rs 334:12 \_ postgres: postgres zms [local] SELECT The database is version 9.2, pg_upgrade is version 9.4.1. In a discussion at lwn.net I've been told, that 9.4.1 already contains fixes for inefficiencies and that it shouldn't be so slow anymore: http://lwn.net/Articles/645600/ What can I do to help improve pg_dump/pg_upgrade for my use case? Regards, Stefan -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs