Re: Abnormal JSON query performance - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Abnormal JSON query performance
Date
Msg-id CAKFQuwapkgj6X9Yv3UH=jaS5uvHCvmcw2RR8e_LWbQ3M3QY_Fw@mail.gmail.com
Whole thread Raw
In response to Re: Abnormal JSON query performance  (reader 1001 <007reader@gmail.com>)
Responses Re: Abnormal JSON query performance  (Dmitry Dolgov <9erthalion6@gmail.com>)
List pgsql-bugs
On Tuesday, May 15, 2018, reader 1001 <007reader@gmail.com> wrote:
Yes, I realized it by now, thank you. 
My question remains for hierarchical keys in a JSON document. If I have a document like below, I clearly can extract key1 using the described rowtype definition. How can I specify selected keys deeper in the document, e.g. key3 and key5? 
{
   key1:value1,
   key2: {
       key3:value3},
       key4:[
         {
            key5:value5
          },
          {
            key6:value6
          }
        ]
    }


I believe you would need a type for each subtree and apply the function multiple times with the result of one feeding the next.

David J. 

pgsql-bugs by date:

Previous
From: reader 1001
Date:
Subject: Re: Abnormal JSON query performance
Next
From: Dmitry Dolgov
Date:
Subject: Re: Abnormal JSON query performance