Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSsQ2-0006O4-Je for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2019 00:14:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hSsQ1-0002uA-6V for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2019 00:14:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSsPz-0002rt-1q for pgsql-general@lists.postgresql.org; Tue, 21 May 2019 00:14:12 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSsPs-0008M7-E2 for pgsql-general@lists.postgresql.org; Tue, 21 May 2019 00:14:09 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B0B9424011; Mon, 20 May 2019 20:14:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 20 May 2019 20:14:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=E atpgPp9xYAOQINAwO2Jax9W0VpvarIeBd8rwJSgrTs=; b=qYZ7pwRV8DD5oRO5q YQ5Eoxm173hY+Vb+pDSwvtIJQwFpv9MMG2QFmNXtoL7FNpl52FzCIOWpwW5vs2NB JC0FXu3pxD/lPrCOzq3QS8kl2NVkRJYimzlAtKnbGnue7ekFJq0B8+bDWY14MWkg h745ud2ezyC8+3RfQSMzpV599YcUKfr1g6EjczTFFTO9T4oqsV+awbTgLvgoYNhm 4NohiNyB6WCYfmWIVjKrbHvMs8wP2o4lk3XCoXjXtOECHiFxIwQMqTD90Z1KjUIx /vaFAx/LcHlm8IwENAWBh+SB9J7d6kZXFUswXn6bsjhHN2XaTwzTL8WuYqMCJP77 X1yfg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=EatpgPp9xYAOQINAwO2Jax9W0VpvarIeBd8rwJSgr Ts=; b=ym0uOXXhwNTqOij/zcp4R8JBCpBdh3spMnpgcsv81W8I9uAhfHJTz1nfh DxZfcJM2fCeBGOuPS9zddbvgrrZt7ym8mA1HS8sS+FwgFKWkN4Vzbn1EA8+Nc0jX BIMNKQYQZj/kIhVZdI1FBoG8iYD3MNAZK7i5tblAGSmvkwxPdMJ4LPbLPKn/XbrK 7aNqQo2izmSWlt2UNjrT+kLN4/ZesPqM0NxzZ+vKc3uXuEjUuBUJ+NxK+FB7gOTR y/mssm77SiVK/SC3W04icWb2pJo1c4DM4Zfg8pt0N4JF9vEHAyHjZYWZPsUcDDi2 9VvmC/V3Z3Vz9TA42Ocz7VCoOOhUw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtledgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepjedurddvuddvrdduhedtrddvtddvnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsth gvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id A9FA780060; Mon, 20 May 2019 20:14:02 -0400 (EDT) Subject: Re: Loading table with indexed jsonb field is stalling To: Will Hartung Cc: Ron , pgsql-general@lists.postgresql.org References: <20505.1558202555@sss.pgh.pa.us> <90835D2B-1FBA-4F26-8157-7C831C24B266@gmail.com> <3A35A039-D8F5-4B40-9B41-42E70BEF2C2E@gmail.com> <806d4915-f05d-8e75-0a42-e11b48596ab5@gmail.com> <12E9FEDD-37E9-4D51-9BA7-94FF5039BB1B@gmail.com> <563e995f-d7b1-7e2f-c1f1-b00db7a18589@gmail.com> <3EF519CA-17FE-4B68-8B7A-78200E0A408F@gmail.com> <7c0a001e-d3d5-c521-1a27-77d05f547fef@aklaver.com> <375E86FF-5B4D-4896-B4ED-FCA8C1D3A60B@gmail.com> From: Adrian Klaver Message-ID: <703a6c76-854d-3d1c-8be6-30864c873d05@aklaver.com> Date: Mon, 20 May 2019 17:14:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <375E86FF-5B4D-4896-B4ED-FCA8C1D3A60B@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/20/19 4:49 PM, Will Hartung wrote: > >> On May 20, 2019, at 4:39 PM, Adrian Klaver > > wrote: >> >> So the issue is building the index(s) not loading the data, correct? > > Correct. > > Since I have been exploring this, I have not been able to successfully > create a gin jsonb_path_ops index on a jsonb field either as a new index > on a table with existing data, or as a pre-existing index on an empty > table and loading the data in. > > The create index does not finish on the existing data, and loading data > does not finish when the index pre-exists. Well looks like you are down to Tom's suggestion of creating a test case. Given that it seems confined to the jsonb field and corresponding index, I would think that is all that is needed for the test case. Start with some smaller subset, say 10,000 rows and work up till you start seeing an issue. > > We currently have a 68M row table loaded in an Aurora instance on AWS (I > do not know the instance/machine size), and the index has been building > for 48 hours now. > > The pg_restore is currently working on that index: > > > CREATE INDEX eis_ent_traits >   ON public.eis_entity >   USING gin >   (traits jsonb_path_ops); > > -- Adrian Klaver adrian.klaver@aklaver.com