pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sbob <sbob@quadratum-braccas.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Best way to parse complex json string into table columns?
Date: Wed, 13 Dec 2023 12:24:56 -0500
Message-ID: <2620242.1702488296@sss.pgh.pa.us> (raw)
In-Reply-To: <d9b41f36-2b7f-4457-b8c2-54493ffa46ce@quadratum-braccas.com>
References: <d9b41f36-2b7f-4457-b8c2-54493ffa46ce@quadratum-braccas.com>

Sbob <sbob@quadratum-braccas.com> writes:
> I have a client that is using a function to parse a set of rows from a 
> table with a json column into table columns in a materialized view.
> ...
> The above approach is painfully slow, is there a better performing 
> method of converting json strings to table columns?

json[b]_populate_record is meant for this sort of thing.

Also, if your source data is actually json not jsonb, that's
a seriously poor choice when you are in need of better
processing speed.

			regards, tom lane





view thread (3+ messages)  latest in thread

Message-ID: <2620242.1702488296@sss.pgh.pa.us>
Permalink:  ../2620242.1702488296@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2620242.1702488296@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sbob@quadratum-braccas.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Best way to parse complex json string into table columns?
  In-Reply-To: <2620242.1702488296@sss.pgh.pa.us>

* 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