Re: JSONB performance enhancement for 9.6

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Tom Smith <tomsmith1989sk(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: JSONB performance enhancement for 9.6
Date: 2015-11-29 12:09:31
Message-ID: 20151129070931.87136dd20cebcfbe5648ddf1@potentialtech.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 28 Nov 2015 21:27:51 -0500
Tom Smith <tomsmith1989sk(at)gmail(dot)com> wrote:
>
> Is there a plan for 9.6 to resolve the issue of very slow query/retrieval
> of jsonb fields
> when there are large number (maybe several thousands) of top level keys.
> Currently, if I save a large json document with top level keys of thousands
> and query/retrieve
> field values, the whole document has to be first decompressed and load to
> memory
> before searching for the specific field key/value.

I could be off-base here, but have you tried:

ATLER TABLE $table ALTER COLUMN $json_column SET STORAGE EXTERNAL;

?

The default storage for a JSONB field is EXTENDED. Switching it to
EXTERNAL will disable compression. You'll have to insert your data over
again, since this change doesn't alter any existing data, but see
if that change improves performance.

--
Bill Moran

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2015-11-29 12:28:36 Re: JSONB performance enhancement for 9.6
Previous Message Steve Petrie, P.Eng. 2015-11-29 10:04:42 Re: using a postgres table as a multi-writer multi-updater queue