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

Re: Hot to model data in DB (PostgreSQL) for SNMP-like multiple configurations

2019-03-08 Thread Alexandru Lazarev
ql.org/docs/9.6/datatype-json.html>* On Fri, Mar 8, 2019 at 5:15 PM Alban Hertroys wrote: > Is there a reason not to use a relational model instead of json(b) here? I > think that is in fact considered best practice. > > On Fri, 8 Mar 2019 at 15:40, Alexandru Lazarev < >

Hot to model data in DB (PostgreSQL) for SNMP-like multiple configurations

2019-03-08 Thread Alexandru Lazarev
I am working on product managing and monitoring Network (NMS-like products). Product manages configuration of network devices, for now each device has stored its configuration in simple table - this was the original design. CREATE TABLE public.configuration( id integer NOT NULL, config json N