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 1hSqG9-0007fe-Ta for pgsql-general@arkaria.postgresql.org; Mon, 20 May 2019 21:55:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hSqG8-0005Hh-FA for pgsql-general@arkaria.postgresql.org; Mon, 20 May 2019 21:55:52 +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 1hSqG7-0005Ha-Vx for pgsql-general@lists.postgresql.org; Mon, 20 May 2019 21:55:52 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSqG1-0005Eq-AJ for pgsql-general@lists.postgresql.org; Mon, 20 May 2019 21:55:50 +0000 Received: by mail-ot1-x343.google.com with SMTP id r10so14465092otd.4 for ; Mon, 20 May 2019 14:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=o5NBymx4cd8bFuCjnQRtLjxRdXgrI1KiUvPgoroUF9k=; b=L82lH+drRj2sqhsv/yU4ktASKASHSQd5kF/+mQmxl7nhMDHNzqK9ort2dUzZvSL/YX Te+cDUwYSZEqMIjES/CG6ZFhgp4bPPPOIO8NRLH9tNae9Hp2w6nN3oXa6eYUp4nTWSso 9cydsHcPwbsdXxJbRz1tgo/7z2fYA8s3OWTg9CQGdY12E2pl3FGc+OPMlmuVnLa2q2qJ taYLpOczMszlLVd28+7ONUzRXVObzvH4qU4h9ivEh7mbI8Q2Za3umKmEiXQS/ntk234o JocWZiipFQeH0wGOc0A9Eg+Fv5U3ywD76DtVYetc7NnP6j5sG/a4dw8AffERzK79h0aM WGgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=o5NBymx4cd8bFuCjnQRtLjxRdXgrI1KiUvPgoroUF9k=; b=SpSWO7g8/QkLq9hOoui2+Qb7fgzdmjfB5elwv0WFHBp3sNMon6utt0OJcuHngdnDN3 ZmzUzJd8F3cn96KcySj4UU0rcEx46fSoFOTDkuPX4deDg1bQsd8qhYqkHoPsKj81jVxO CU0/8P/VdYfEa2xRGCJvDJlb04EepActgS4xmz+VWFQyCwFLCAYeMC5tBWOpUzHeCcA5 V+ZQJ76kzU/9Gz5Ouy/DxClpe5U9CtzwJqBKGlF79wXszUMtBggWvFkVRhhiHo0Ezccw fCQOI2ZA8LcTTNtCotCGaQFC4O/VZ4QN8tcLrKSH9WI5NW5BY4lru0f+Ctx+rGmkYdsh lirg== X-Gm-Message-State: APjAAAWHgMVW2Jct6MwpSeKzlRI9hG9q1mjygYyx3gugQjk3eagpV0NF h2dQW8+4WwdEwI4mvLlm4/IOalB3q1GrCw== X-Google-Smtp-Source: APXvYqyTfP/h0OFKuK1C+dXDvQYe78Jo4iH0cC67vyHQJkW9+dcRh82jG3MwtWBU3Avm1/LEBo4uhw== X-Received: by 2002:a9d:69d9:: with SMTP id v25mr223138oto.4.1558389344263; Mon, 20 May 2019 14:55:44 -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 p132sm6806338oig.37.2019.05.20.14.55.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 14:55:43 -0700 (PDT) Subject: Re: Loading table with indexed jsonb field is stalling To: Will Hartung Cc: 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> From: Ron Message-ID: <563e995f-d7b1-7e2f-c1f1-b00db7a18589@gmail.com> Date: Mon, 20 May 2019 16:55:42 -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: <12E9FEDD-37E9-4D51-9BA7-94FF5039BB1B@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/20/19 4:48 PM, Will Hartung wrote: >> On May 20, 2019, at 2:36 PM, Ron wrote: >> I think you answered this earlier, but does the same stalling happen when indexes are dropped? > No, the data loads fine. > > The way I originally stumbled upon this was that I had off loaded the data for some other kinds of testing. > > There are several indexes in production, but for my local testing, I only had one on the pk. And it pathologically loads even when there's just a PK on the numeric field? > Then, one day, I wanted to look for something, and decided I’ll build the json index “real quick”. > > Being me, it wasn’t until a few days later I’m like “why is my machine busy, what’s that grinding sound” (I rarely hear my drive, most work is done on SSD). > > Then I realized that the index was still being built, several days later. > > “Huh” > > And I left it again. > > I was, again, not really paying attention, and didn’t realize until 2 weeks after I had started that it was STILL running. > > At that point I killed it. > > Then I decided to break the file up and load it in chunks, see “how far” it was getting, etc. It did not take long for it to get stuck. > > I tried it on different versions of PG, now on different OS’s (albeit one is in a VM). It wasn’t a crisis, just a curiosity. > > But we had a scary event couple of weeks ago that may have forced us to reload the table, but, thankfully, didn’t and we recovered. But got me to thinking about poking at it again. Drop all indexes, load data, recreate indexes? > A colleague is trying to pg_restore our production DB for a conversion test to AWS Aurora, and it’s been stuck for 43 hours on 68M row loaded table. So, it’s systemic with our data, and I believe that we can not reload this table currently. Which is scary. But pg_restore only creates indexes AFTER the data loads. -- Angular momentum makes the world go 'round.