From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | veem v <veema0000(at)gmail(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Performance of JSON type in postgres |
Date: | 2025-07-19 20:59:36 |
Message-ID: | 289f005c-4a80-4098-bf58-f53e06bb7f8c@aklaver.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | 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(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | veem v | 2025-07-19 21:19:14 | Re: Performance of JSON type in postgres |
Previous Message | veem v | 2025-07-19 20:39:56 | Re: Performance of JSON type in postgres |