Removing a key from jsonb is sloooow

From: Volkan Unsal <spocksplanet(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Removing a key from jsonb is sloooow
Date: 2019-07-17 14:30:40
Message-ID: CAMcqKmnaJS_xnuKY6j2e+uZbHXhrtDx6SaDcRp-ZMYPfAbsOKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-07-17 14:39:36 Re: Removing a key from jsonb is sloooow
Previous Message Rory Campbell-Lange 2019-07-17 11:34:41 Re: How to run a task continuously in the background