Why is writing JSONB faster than just JSON? - Mailing list pgsql-general

From Mitar
Subject Why is writing JSONB faster than just JSON?
Date
Msg-id CAKLmikORKREgCE8F69NUcbi6aSo-ZrU75P0Jb8adaqpEVqS0Kg@mail.gmail.com
Whole thread Raw
Responses Re: Why is writing JSONB faster than just JSON?  (Dmitry Dolgov <9erthalion6@gmail.com>)
List pgsql-general
Hi!

I have a project where we among other data want to store static JSON
objects which can get pretty large (10-100 KB). I was trying to
evaluate how it would work if we simply store it as an additional
column in a PostgreSQL database. So I made a benchmark [1]. The
results surprised me a bit and I am writing here because I would like
to understand them. Namely, it looks like writing into a jsonb typed
column is 30% faster than writing into a json typed column. Why is
that? Does not jsonb require parsing of JSON and conversion? That
should be slower than just storing a blob as-is?

[1] https://gitlab.com/mitar/benchmark-pg-json


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m



pgsql-general by date:

Previous
From: Kevin Brannen
Date:
Subject: RE: [Extern] Re: Advice on binary installation
Next
From: Dmitry Dolgov
Date:
Subject: Re: Why is writing JSONB faster than just JSON?