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 1hSsRC-0006QF-EI for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2019 00:15:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hSsRB-0006fO-76 for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2019 00:15:25 +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 1hSsRA-0006fH-Ob for pgsql-general@lists.postgresql.org; Tue, 21 May 2019 00:15:24 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSsR4-0008N9-M1 for pgsql-general@lists.postgresql.org; Tue, 21 May 2019 00:15:23 +0000 Received: by mail-ot1-x333.google.com with SMTP id n14so14731224otk.2 for ; Mon, 20 May 2019 17:15:18 -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=GCBNOARQMfqqMn0OSTHz5l3gt+xNImbwrX2jrqwjhWs=; b=JgCGxcXJ14UvZkCG3Zxqm5m94UY+IAkxGW31l2tsr/JUvLj1WUWIGHBtOkT8WWZEmE mjtS8mmd8OKHQz2fHtxHQ9Nip+PANfKA7FlWkum2RtAMbNBCGIv5148SCWyhYbYBKQRu G2LLZmY1r0APpwFXTAHKdeqXTYuk0mDVWOmc0fVuGaqABaXEN1Gkqm5goOt6gmro4dmv eIBfEny52NrmG1aKwwLnHiRinrm9xUvb8tZNgHQEBfFtiyJTPgBpKKXNYHnjNT1LXbgP mZ+V0+UYSWnwdUGPox/cAa3vQjzXqjl3IWPvDXSPv4nddrk8vKHjsv6xw8nvPRUAB3bl o3hA== 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=GCBNOARQMfqqMn0OSTHz5l3gt+xNImbwrX2jrqwjhWs=; b=ebYrasrAMfdomU8jkQvqpic69ueaCr5BseJo2C338/YZh3dLVq+9VJroAoQk5g+aMl 5uyDr5rDE8PD+dtctA3VEPOMHlGX4T+zRHBG+7GkmSu9MY4ZRdC9sQFygmK0sXzage94 UYn8cZgN3mDC8WBlO/rBiJ/M7o6LsKXBHk88jFu5wDityWKafmpQGULKyuPT+z7c95Vo MSNcBlHglsM90FJ7c8ZomFEaINuBD5xjaWrSNlmwZ6inNMwRIabeKEWCm7jRphTQYh44 5kFikN7aRTBL/qToD4ymfXCOfH2Vv5d2FskNv3w1rfq3XRA6Ut6g3V5Z26Vo91cSDwyk u4kQ== X-Gm-Message-State: APjAAAU/V3suB52p7PY7nAzVDHiEzYPcc2Twb7LcAHmFUHX0C2Wrox6w MJZ596/SxoTD8lQCc0XnG/DyW+EMOnv6ZQ== X-Google-Smtp-Source: APXvYqxWV9bkjnCpBzijrHt1fTZURmGvQhDYA8HZXfvof6B2Zb6JUp8xJiqGuIg+lro0YJZvwGorww== X-Received: by 2002:a9d:735a:: with SMTP id l26mr26519003otk.308.1558397717633; Mon, 20 May 2019 17:15:17 -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 i5sm492595otf.26.2019.05.20.17.15.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 17:15:16 -0700 (PDT) Subject: Re: Loading table with indexed jsonb field is stalling To: 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> <71e50367-2375-86a8-f795-97c894728998@gmail.com> <3CC10064-7BF0-4600-BC67-8B6F412C9CDC@gmail.com> From: Ron Message-ID: <0a8876b8-f4de-4bc2-72c8-afe5dfe6fde2@gmail.com> Date: Mon, 20 May 2019 19:15:16 -0500 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: <3CC10064-7BF0-4600-BC67-8B6F412C9CDC@gmail.com> Content-Type: multipart/alternative; boundary="------------A18D5D4EA4EE3EE8BD240DB2" 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. --------------A18D5D4EA4EE3EE8BD240DB2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 5/20/19 6:51 PM, Will Hartung wrote: >> On May 20, 2019, at 4:27 PM, Ron > > wrote: >> >> I'm confused.  You wrote above that loading without indexes and with just >> the PK works just fine; if you *really* need it loaded in Aurora or >> production, just drop the indexes beforehand? > > Because the jsonb_path_ops index does not rebuild, and it’s the heart of > that table. > > The table is essentially worthless without that index to us. Clarified. Are there a sufficiently small number of elements in each traits object that you can do something like this, on the UNINDEXED table? SELECT traits->element1, traits->element2, count(*) from eis_entry group by traits->element1, traits->element2; Sure it would run for a long time, but might show you where the problem lies. -- Angular momentum makes the world go 'round. --------------A18D5D4EA4EE3EE8BD240DB2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 5/20/19 6:51 PM, Will Hartung wrote:
On May 20, 2019, at 4:27 PM, Ron <ronljohnsonjr@gmail.com> wrote:

I'm confused.  You wrote above that loading without indexes and with just the PK works just fine; if you really need it loaded in Aurora or production, just drop the indexes beforehand?

Because the jsonb_path_ops index does not rebuild, and it’s the heart of that table.

The table is essentially worthless without that index to us.

Clarified.

Are there a sufficiently small number of elements in each traits object that you can do something like this, on the UNINDEXED table?
SELECT traits->element1, traits->element2, count(*)
from eis_entry
group by traits->element1, traits->element2;

Sure it would run for a long time, but might show you where the problem lies.


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