Re: JSON vs. JSONB storage size

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: JSON vs. JSONB storage size
Date: 2019-10-11 14:16:24
Message-ID: CA+q6zcVvJoBzhPOK9ouy_TgqwDBWcgvedxPVf4G7B4iRq8AAYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Fri, Oct 11, 2019 at 1:40 PM Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:
>
> I am a bit surprised by this (not because the jsonb sizes are generally
> bigger, but that the string value takes less space)
>
> Is this caused by the fact that a string value compresses better internally?

Those jsonb objects are quite small, so it could be that an alignment kicks in,
since as far as I remember, jsonb header and data should be aligned by 4 byte
boundary.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-10-11 14:21:27 Re: JSON vs. JSONB storage size
Previous Message Tom Lane 2019-10-11 14:08:37 Re: Issues with PAM : log that it failed, whether it actually failed or not