title: How to create index on json array in postgres?
body: <p>I have a json field called 'elements' in my table demo which contains an array 'data' containing key value pairs. the 'data' array has the below structure. the data array may have multiple json entries.I am using postgres version 9.5</p>
  
  <pre><code>{
      "data": [{
          "ownr": "1",
          "sigUsr": [2],
          "sigStat": "APPR",
          "modifiedOn": 1494229698039,
          "isDel": "false",
          "parentId": "nil",
          "disName": "exmp.json",
          "uniqueId": "d88cb52",
          "usrType": "owner",
          "usrId": "1",
          "createdOn": 1494229698039,
          "obType": "file"
      }]
  }
  </code></pre>
  
  <p>In my query I have multiple filters based on obj(Eg : <code>obj-&gt;&gt;usrId</code>, <code>obj-&gt;&gt;sigUsr</code> etc)  where obj corresponds to <code>json_array_elements(demo.elements-&gt;'data')</code>.How do I create btree indices on filters like <code>obj-&gt;&gt;userId</code> ,<code>obj-&gt;&gt;sigUsr</code>? Please revert.</p>
  
  <p>Regards
  sur</p>