Thank you, I updated my test to insert 10,000 rows where each row has a JSON or 
JSONB with 100 keys (I do not have a use case of 1000), here are the results:

7. Insert 10,000 rows to JSON (100 items in each row), execution time (sec):
119.411994457


8. Insert 10,000 rows to JSONB (100 items in each row), execution time (sec):
118.248999119

Thanks
Ronny

From: Dmitry Dolgov [mailto:9erthali...@gmail.com]
Sent: Monday, May 15, 2017 3:35 PM
To: Ronny Abraham
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

On 15 May 2017 at 19:25, Ronny Abraham 
<rabra...@kns.com<mailto:rabra...@kns.com>> wrote:
>
> What’s interesting is that inserting to JSONB is slightly faster than 
> inserting to JSON.
>
> Maybe that’s because my JSON has a flat structure (no nesting), or maybe I am 
> doing something else wrong?

I assume it's because your json documents (10 fields) are not big enough. If 
you'll try the same tests
with something like 1000 keys for each document, there should be noticeable 
difference (at least in my
case it was like that).

________________________________

This email is non-binding, is subject to contract, and neither Kulicke and 
Soffa Industries, Inc. nor its subsidiaries (each and collectively “K&S”) shall 
have any obligation to you to consummate the transactions herein or to enter 
into any agreement, other than in accordance with the terms and conditions of a 
definitive agreement if and when negotiated, finalized and executed between the 
parties. This email and all its contents are protected by International and 
United States copyright laws. Any reproduction or use of all or any part of 
this email without the express written consent of K&S is prohibited.

Reply via email to