From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Volkan Unsal <spocksplanet@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: Removing a key from jsonb is sloooow
Date: Wed, 17 Jul 2019 07:39:36 -0700
Message-ID: <553286cb-47f5-bf94-42f2-12d1f489fbdf@aklaver.com> (raw)
In-Reply-To: <CAMcqKmnaJS_xnuKY6j2e+uZbHXhrtDx6SaDcRp-ZMYPfAbsOKw@mail.gmail.com>
References: <CAMcqKmnaJS_xnuKY6j2e+uZbHXhrtDx6SaDcRp-ZMYPfAbsOKw@mail.gmail.com>
On 7/17/19 7:30 AM, Volkan Unsal wrote:
> I'm trying to remove a key from a jsonb column in a table with 10K rows,
> and the performance is abysmal. When the key is missing, it takes 5
> minutes. When the key is present, it takes even longer.
>
> Test with non-existent key:
>
> >> update projects set misc = misc - 'foo';
> Time: 324711.960 ms (05:24.712)
>
> What can I do to improve this?
Provide some useful information:
1) Postgres version
2) Table schema
3) Explain analyze of query
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, spocksplanet@gmail.com
Subject: Re: Removing a key from jsonb is sloooow
In-Reply-To: <553286cb-47f5-bf94-42f2-12d1f489fbdf@aklaver.com>
References: <CAMcqKmnaJS_xnuKY6j2e+uZbHXhrtDx6SaDcRp-ZMYPfAbsOKw@mail.gmail.com> <553286cb-47f5-bf94-42f2-12d1f489fbdf@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox