Search Postgresql Archives

Re: Insert performance and disk usage in JSON vs JSONB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 15, 2017 at 12:02 PM, Ronny Abraham <rabraham@xxxxxxx> wrote:
> 4. Insert 10,000 rows to JSON, execution time (sec):
> 5. Insert 10,000 rows to JSONB, execution time (sec):
>
> What’s interesting is that inserting to JSONB is slightly faster than
> inserting to JSON.

With those times, only explanation is that you are bottlenecked by
storage fsync time.  If storage is fast, you should be able to do 10k
inserts per second+ for either type unless the documents are large.

For storing documents, you should only consider using the json type if
the exact structure of the originating document is important for the
most part.  For querying and manipulation it's better and faster
(mostly) and the API is more robust.

The json type has other uses; mainly for serialization from non-json
data but that's not a storage consideration.

merlin


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux