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 1hSq8k-0007M0-BZ for pgsql-general@arkaria.postgresql.org; Mon, 20 May 2019 21:48: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 1hSq8i-0002hf-Rw for pgsql-general@arkaria.postgresql.org; Mon, 20 May 2019 21:48:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSq8i-0002hY-IZ for pgsql-general@lists.postgresql.org; Mon, 20 May 2019 21:48:12 +0000 Received: from mail-it1-x143.google.com ([2607:f8b0:4864:20::143]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSq8g-00022H-4E for pgsql-general@lists.postgresql.org; Mon, 20 May 2019 21:48:11 +0000 Received: by mail-it1-x143.google.com with SMTP id e184so1496557ite.1 for ; Mon, 20 May 2019 14:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ANW7FMcuxtquuGW4S/eNF8vfqPEIaOWBuuOKG/GRe6g=; b=iqARu7ELj8Uyuim6LjSbrxdKHfWCZdgN/YAJRF/C85J3/4pRfUl+bEMCdI/uuYJVpn LoP11XGFs7hDWEsyphnYe7E+DINQbqjlmRZ95rq+EJXvahqwBh+J41I2Tp2OEX7Qk0en yt2Ch9DaNn7KgCxzxKPvL6SHU1dCKH/1gFM94VOCLK5P61+Wt693Nz2ZiFJa9+K/GmBZ Sz1NbiLxR4WK87j+Q9yOXMf/WyFN/8uGYZO8Bjdu5B7oDc9wwcxpa47rvQYF1Za4tm1F AoH8TG4DNbbWPWAIag+f+MyvIx51pPpNa/ceaMWJ1qlaXwyOSB+XNHTAHW7luQm+YqN5 QHJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ANW7FMcuxtquuGW4S/eNF8vfqPEIaOWBuuOKG/GRe6g=; b=PhK8scwtDYGUMlcOP9XBqfJzaMS9gBQe9IVtcQwBvqh3Y54ELLiSHcDb0xZ+LdaqTH NjdX+Fs3WdwSe9l1UvBZM29l5GjX1rxxVLtPAOFEhpSUB1OPqJRr4HCt8JN6xbYhD/cm ggduAKzdwIJQZxXQu++a8y95O1lKuaAbRJMatYNYCe1f90dZMol4JoGiP3ZJOLNt3yEB Gy/kfB6Dtl9MPZyxPiAwBbyOzTI1CUy9cPUPYhitygSeNyy0fiWdKZ5L+dIyIAT1TBUy 72O+kjKQh8A+/RSaGZUQqam8bqwyTMXHlRxqnn+4ubPMYAY/MWAU+AYAd7LtMJpeljby eAuA== X-Gm-Message-State: APjAAAUwvFa5zMj0phzBsP7KL/qpaP481Zkj3SWV4n0HiY/kWcmqmRUq TM5RJLs3Tdq4mxTQegQb50goQBQW X-Google-Smtp-Source: APXvYqwBAwY2WQITaM7czKqoge/92exU13Fz5HG+q+J62gAuxOJV8PH8EFvcRC9TbtGds9AbbVqTOQ== X-Received: by 2002:a24:44d2:: with SMTP id o201mr990218ita.58.1558388888758; Mon, 20 May 2019 14:48:08 -0700 (PDT) Received: from [10.35.60.64] ([64.164.57.170]) by smtp.gmail.com with ESMTPSA id x20sm6097856ioa.40.2019.05.20.14.48.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 14:48:07 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Loading table with indexed jsonb field is stalling From: Will Hartung In-Reply-To: <806d4915-f05d-8e75-0a42-e11b48596ab5@gmail.com> Date: Mon, 20 May 2019 14:48:05 -0700 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <12E9FEDD-37E9-4D51-9BA7-94FF5039BB1B@gmail.com> 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> To: Ron X-Mailer: Apple Mail (2.3124) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > 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. Then, one day, I wanted to look for something, and decided I=E2=80=99ll = build the json index =E2=80=9Creal quick=E2=80=9D. Being me, it wasn=E2=80=99t until a few days later I=E2=80=99m like = =E2=80=9Cwhy is my machine busy, what=E2=80=99s that grinding sound=E2=80=9D= (I rarely hear my drive, most work is done on SSD). Then I realized that the index was still being built, several days = later. =E2=80=9CHuh=E2=80=9D And I left it again. I was, again, not really paying attention, and didn=E2=80=99t 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 =E2=80=9Cho= w far=E2=80=9D 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=E2=80=99s = (albeit one is in a VM). It wasn=E2=80=99t 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=E2=80=99t and we recovered. But = got me to thinking about poking at it again. A colleague is trying to pg_restore our production DB for a conversion = test to AWS Aurora, and it=E2=80=99s been stuck for 43 hours on 68M row = loaded table. So, it=E2=80=99s systemic with our data, and I believe = that we can not reload this table currently. Which is scary. And here we are.