Re: jsonb_set performance degradation / multiple jsonb_set on multiple documents

2019-03-15 Thread Michel Pelletier
I don't know the details of jsonb_set, Perhaps the '||' operator will perform better for you, it will overwrite existing keys, so you can build your new values in a new object, and then || it to the original. postgres=# select '{"a": 1, "b": 2, "c": 3}'::jsonb || '{"b": 4, "c": 5}'::jsonb;

jsonb_set performance degradation / multiple jsonb_set on multiple documents

2019-03-15 Thread Alexandru Lazarev
Hi PostgreSQL Community. I tried to rewrite some plv8 stored procedures, which process in bulk JSONB documents, to PL/pgSQL. A SP usually has to delete/update/add multiple key with the same document and do it for multiple documents (~40K) in loop. When updating a single key PL/pgSQL wins against