Re: [GENERAL] performance considerations of jsonb vs separate rows

Поиск
Список
Период
Сортировка
От Dmitry Dolgov
Тема Re: [GENERAL] performance considerations of jsonb vs separate rows
Дата
Msg-id CA+q6zcXpaNXDQ2Oo3dW=mztwS6Q6BcFzwaBnygLJ-FYDCKBJaA@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] performance considerations of jsonb vs separate rows  (Rob Nikander <rob.nikander@gmail.com>)
Список pgsql-general
> On 19 June 2017 at 21:29, Rob Nikander <rob.nikander@gmail.com> wrote:
>
> I'm wondering about the tradeoffs, specifically: is it possible to update one piece of a jsonb value without having to rewrite the entire field? There are cases where that data field was getting pretty big (500kb). Would you expect any obvious performance differences between these two options?

Unfortunately no, an entire jsonb field has to be written back even if you've touched only one key.
From my own benchmarks it looks like you'll scarcely notice this (e.g. in comparison with MongoDB) only if you work
with small enough documents (about 2kb), and everything above this limit more or less seriously hit the performance.
You can take a look at this presentation [1] from Oleg Bartunov, it contains results of some benchmarks (from slide 44).

[1]: http://www.sai.msu.su/~megera/postgres/talks/jsonb-pgconf.us-2017.pdf

В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [GENERAL] performance considerations of jsonb vs separate rows
Следующее
От: Dmitry O Litvintsev
Дата:
Сообщение: Re: [GENERAL] autovacuum holds exclusive lock on table preventing itfrom to be updated