Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVNW0-00041o-6P for pgsql-performance@arkaria.postgresql.org; Wed, 12 Jul 2017 19:41:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dVNVz-0007WX-13 for pgsql-performance@arkaria.postgresql.org; Wed, 12 Jul 2017 19:41:39 +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.84_2) (envelope-from ) id 1dVNVx-0007Uz-LL for pgsql-performance@postgresql.org; Wed, 12 Jul 2017 19:41:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dVNVq-0005gs-OE for pgsql-performance@postgresql.org; Wed, 12 Jul 2017 19:41:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v6CJfSpv024672; Wed, 12 Jul 2017 15:41:28 -0400 From: Tom Lane To: Hans Braxmeier cc: "pgsql-performance@postgresql.org" Subject: Re: Postgres Dump - Creating index never stops In-reply-to: References: Comments: In-reply-to Hans Braxmeier message dated "Wed, 12 Jul 2017 19:00:45 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24670.1499888488.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 12 Jul 2017 15:41:28 -0400 Message-ID: <24671.1499888488@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hans Braxmeier writes: > After restarting postgres (even with a new cluster) and creating a new da= tabase, postgres is hanging while extracting the dump: gunzip -c pixabay.gz= | psql pixabay > The log file shows that the autovacuum task is running (almost) endless... > 2017-07-12 18:05:52.367 CEST [19586] hans@pixabay LOG: duration: 11.609 = ms statement: CREATE INDEX photos_indexphoto_created ON photos_indexphoto = USING btree (created); > 2017-07-12 20:34:58.943 CEST [19626] ERROR: canceling autovacuum task > 2017-07-12 20:34:58.943 CEST [19626] CONTEXT: automatic analyze of table= "pixabay.public.photos_photo" > 2017-07-12 20:34:59.942 CEST [19586] hans@pixabay LOG: duration: 8947575= .013 ms statement: CREATE INDEX photos_photo_approved_by_id ON photos_phot= o USING btree (approved_by_id); What that looks like is it took the system an unusually long time to notice that it needed to cancel the autovacuum to avoid a deadlock with the CREATE INDEX. Was either process consuming a noticeable amount of CPU during that interval? Do you have deadlock_timeout set higher than the default 1s? regards, tom lane --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance