jsonb_delete with arrays - Mailing list pgsql-hackers

From Magnus Hagander
Subject jsonb_delete with arrays
Date
Msg-id CABUevEyvMa2wKntZ9bcgJo_cYFPR+TNHJQkUm3nb+D8+5XwaTg@mail.gmail.com
Whole thread Raw
Responses Re: jsonb_delete with arrays  (Dmitry Dolgov <9erthalion6@gmail.com>)
List pgsql-hackers
Attached is an implantation of jsonb_delete that instead of taking a single key to remove accepts an array of keys (it still does just keys, so it's using the - operator, it's not like the path delete function that also takes an array, but uses a different operator).

In some simple testing of working through a real world usecases where we needed to delete 7 keys from jsonb data, it shows approximately a 9x speedup over calling the - operator multiple times. I'm guessing since we copy a lot less and don't have to re-traverse the structure.
Attachment

pgsql-hackers by date:

Previous
From: Kuntal Ghosh
Date:
Subject: Re: WAL consistency check facility
Next
From: Kevin Grittner
Date:
Subject: Re: Snapshot too old logging