From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Mitar <mmitar@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org
Subject: Re: Why is writing JSONB faster than just JSON?
Date: Sun, 2 May 2021 14:50:47 +0200
Message-ID: <20210502125047.vzsksguxxzv34vio@localhost> (raw)
In-Reply-To: <CAKLmikOg2i3PxPNPrxcMJ1hsuOoicwxC8_xoK7TF4OBjjKEaKw@mail.gmail.com>
References: <CAKLmikORKREgCE8F69NUcbi6aSo-ZrU75P0Jb8adaqpEVqS0Kg@mail.gmail.com>
<20210414084845.rkbe525twb4jr4fw@localhost>
<3488585.1618410383@sss.pgh.pa.us>
<20210415154311.t3meozbednmsfhxx@localhost>
<3785442.1618505245@sss.pgh.pa.us>
<20210415191140.pu4jukp6245wkzit@localhost>
<CAKLmikOg2i3PxPNPrxcMJ1hsuOoicwxC8_xoK7TF4OBjjKEaKw@mail.gmail.com>
> On Fri, Apr 23, 2021 at 01:56:57AM -0700, Mitar wrote:
> Hi!
>
> On Thu, Apr 15, 2021 at 12:11 PM Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> > > My point was that for JSON, after validating that the input is
> > > syntactically correct, we just store it as-received. So in particular
> > > the amount of whitespace in the value would depend on how the client
> > > had chosen to format the JSON. This'd affect the stored size of
> > > course, and I think it would have an effect on compression time too.
> >
> > Yes, I got it and just wanted to confirm you were right - this was the
> > reason I've observed slowdown trying to reproduce the report.
>
> Thank you for trying to reproduce the report. I did a bit more digging
> myself and I am still confused.
>
> ...
>
> So I do not know what is happening and why you cannot reproduce it.
Could you maybe get a profile with perf for both cases? Since they're
executed within a single backend, you can profile only a single pid.
Having a reasonable profiling frequency, --call-graph dwarf and probably
limit events to only user space with precise tagging (cycles:uppp)
should give an impression what's going on.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: 9erthalion6@gmail.com, mmitar@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: Why is writing JSONB faster than just JSON?
In-Reply-To: <20210502125047.vzsksguxxzv34vio@localhost>
References: <CAKLmikORKREgCE8F69NUcbi6aSo-ZrU75P0Jb8adaqpEVqS0Kg@mail.gmail.com> <20210414084845.rkbe525twb4jr4fw@localhost> <3488585.1618410383@sss.pgh.pa.us> <20210415154311.t3meozbednmsfhxx@localhost> <3785442.1618505245@sss.pgh.pa.us> <20210415191140.pu4jukp6245wkzit@localhost> <CAKLmikOg2i3PxPNPrxcMJ1hsuOoicwxC8_xoK7TF4OBjjKEaKw@mail.gmail.com> <20210502125047.vzsksguxxzv34vio@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox