Re: Performance of JSON type in postgres - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Performance of JSON type in postgres
Date
Msg-id 289f005c-4a80-4098-bf58-f53e06bb7f8c@aklaver.com
Whole thread Raw
In response to Re: Performance of JSON type in postgres  (veem v <veema0000@gmail.com>)
Responses Re: Performance of JSON type in postgres
List pgsql-general
On 7/19/25 13:39, veem v wrote:
> 

> Thank you.
> 
> I tested below for sample data. I see loading or serialization seems a 
> lot slower(twice as slower) in JSONB as compared to JSON. Whereas 
> storage looks efficient in JSONB. and reading performance of nested 
> fields are 7-8 times slower in JSON as compared to JSONB(and ofcourse 
> index support makes it a better choice here). Hope i am testing it 
> correctly here.
> 
> https://dbfiddle.uk/6P7sjL22 <https://dbfiddle.uk/6P7sjL22>
> 
> So I am a bit confused here . Also one of our use case is, along with 
> persisting this data and querying it in postgres database, We are also 
> going to move this data from postgres (which is a upstream OLTP system) 
> to a downstream OLAP system ,which is in Snowflake database which is 
> having data types like Variant or Varchar types. So, will it create a 
> significant difference if we store it in JSON vs JSONB in our postgres 
> i.e the source/upstream database?

I thought you are answered that with your tests above? At least for the 
Postgres end. As to the Snowflake end you will need to do comparable 
tests for fetching the data from Postgres and transforming it.

-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: veem v
Date:
Subject: Re: Performance of JSON type in postgres
Next
From: veem v
Date:
Subject: Re: Performance of JSON type in postgres