Re: Jsonb extraction very slow - Mailing list pgsql-general

From Tom Lane
Subject Re: Jsonb extraction very slow
Date
Msg-id 22161.1470752988@sss.pgh.pa.us
Whole thread Raw
In response to Jsonb extraction very slow  ("hari.prasath" <hari.prasath@zohocorp.com>)
Responses Re: Jsonb extraction very slow  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-general
"hari.prasath" <hari.prasath@zohocorp.com> writes:
>      I am using jsonb for storing key-value pair information(500 keys) and it was a very big data set with some 10M
rows.Whenever i try to extract some keys(let say some 10 keys and its values) its really very slow. 
> Is this due to jsonb parsing (or) each time json will be loaded from disk to memory for 10keys(mainly if my keys are
atend of 500 this is very slow).? 

It's probably mostly the cost to fetch and decompress the very wide json
field.  jsonb is pretty quick at finding an object key once it's got
the value available to look at.

You could possibly alleviate some of the speed issue by storing the column
uncompressed (see ALTER TABLE ... SET STORAGE EXTERNAL), but that would
bloat your disk space requirements so I'm not really sure it'd be a win.

            regards, tom lane


pgsql-general by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Column order in multi column primary key
Next
From: "Rader, David"
Date:
Subject: Re: [BUGS] BUG #14285: Chinese locale and windows