Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB
Дата
Msg-id CAHyXU0wYwF7s_UnSYMPN1Wv3yjrKnJS+-i15ZqhP3SEzJU0vzg@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Insert performance and disk usage in JSON vs JSONB  (Ronny Abraham <rabraham@kns.com>)
Список pgsql-general
On Mon, May 15, 2017 at 12:02 PM, Ronny Abraham <rabraham@kns.com> wrote:
> 4. Insert 10,000 rows to JSON, execution time (sec):
> 5. Insert 10,000 rows to JSONB, execution time (sec):
>
> What’s interesting is that inserting to JSONB is slightly faster than
> inserting to JSON.

With those times, only explanation is that you are bottlenecked by
storage fsync time.  If storage is fast, you should be able to do 10k
inserts per second+ for either type unless the documents are large.

For storing documents, you should only consider using the json type if
the exact structure of the originating document is important for the
most part.  For querying and manipulation it's better and faster
(mostly) and the API is more robust.

The json type has other uses; mainly for serialization from non-json
data but that's not a storage consideration.

merlin


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

Предыдущее
От: Devrim Gündüz
Дата:
Сообщение: Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2on Centos 6.9
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB