Re: working around JSONB's lack of stats? - Mailing list pgsql-performance

From Peter Geoghegan
Subject Re: working around JSONB's lack of stats?
Date
Msg-id CAEYLb_VsR0GDpFkuYKCa6srN4yk2K+NkLUi0a5heXtksAd00ag@mail.gmail.com
Whole thread Raw
In response to Re: working around JSONB's lack of stats?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
On Wed, Jan 28, 2015 at 3:42 PM, Josh Berkus <josh@agliodbs.com> wrote:
> jsonb_col @> '[ "key1" ]'
> or jsonb_col ? 'key1'
>         if in MCE, assign % from MCE
>         otherwise assign 1% of non-MCE %
>
> jsonb_col @> '{ "key1": "value1" }'
>         if in MCE, assign MCE% * 0.1
>         otherwise assign 0.01 of non-MCE %
>
> Does that make sense?

I suspect it makes a lot less sense. The way people seem to want to
use jsonb is as a document store with a bit of flexibility. Individual
JSON documents tend to be fairly homogeneous in structure within a
table, just like with systems like MongoDB. Strings within arrays are
keys for our purposes, and these are often used for tags and so on.
But Strings that are the key of an object/pair are much less useful to
index, in my estimation.

--
Regards,
Peter Geoghegan


pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: working around JSONB's lack of stats?
Next
From: Tomas Vondra
Date:
Subject: Re: working around JSONB's lack of stats?