Re: json indexing and data types

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Kaare Rasmussen <kaare(at)jasonic(dot)dk>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: json indexing and data types
Date: 2015-12-03 14:30:21
Message-ID: CAHyXU0zNxjmGbtECc2jg8cM9x3tSN-NLmNKRjSZbtnsX4EGQ4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 2, 2015 at 7:11 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> On 12/2/15 7:06 PM, Merlin Moncure wrote:
>>
>> > The basics is, that I have a column with what is essentially json data;
>> a
>> > number of data structures of different depths. Perhaps 10 - 30 top
>> levels,
>> > and probably no more than 3, max 4 levels deep. In total there are some
>> > hundred thousands of rows in each table. It would probably be best
>> stored as
>> > jsonb. Right now it's text, because it's only used by the application
>> > itself.
>
>
> After re-reading this part...
>
> Are you in control of the JSON itself, and are the number of permutations
> known in advance? It might be that something like table inheritance is a
> better solution...

Yeah, or other data storage strategies that are btree friendly but not
'schema rigid', like EAV (perhaps a modified variant to support
storing the document structure). There are definitely tradeoffs
involved but you have to consider all the options.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2015-12-03 14:36:53 Re: plperlu stored procedure seems to freeze for a minute
Previous Message Merlin Moncure 2015-12-03 14:25:53 Re: json indexing and data types