Index :
CREATE INDEX idx_dRt_pol_cId
ON dataRT( DISTINCT ARRAY v.clients FOR v WITHIN SELF.clients[*].id END )
WHERE type_='Policy';
Query:
select d.* from dataRT d UNNEST d.clients cust
where d.type_= 'Policy' AND cust.id = "50007554";
Still, it’s taking 30 min. I have 10 million records for policy document.