Re: Why is writing JSONB faster than just JSON?

From: Mitar <mmitar(at)gmail(dot)com>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why is writing JSONB faster than just JSON?
Date: 2021-04-23 19:04:00
Message-ID: CAKLmikPP5F1oTRQszeT24V+EWZtM=PgL0wZNF5XG-uSM36dSvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

On Fri, Apr 23, 2021 at 10:49 AM Francisco Olarte
<folarte(at)peoplecall(dot)com> wrote:
> Of course, I did not follow the thread to deeply, just pointed that in
> case you were assuming that was not going to be stored compressed.

Thanks for pointing that out. I was just trying to make sure I am
understanding you correctly and that we are all on the same page about
implications. It seems we are.

> Also, not surprised JSONB ends up being fatter,

Yes, by itself this is not surprising. Why I mentioned it is because
in my original post in this thread, I posted that I am surprised that
inserting into JSONB column seems observably faster than into JSON or
TEXT column (for same data) and I wonder why that is. One theory
presented was that JSONB might compress better so there is less IO so
insertion is faster. But JSONB does not look more compressed (I have
not measured the size in my original benchmark), so now I am searching
for other explanations for the results of my benchmark.

Mitar

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric Hill 2021-04-23 19:08:39 Re: server process exited with code 1
Previous Message Francisco Olarte 2021-04-23 17:48:41 Re: Why is writing JSONB faster than just JSON?