Need Help with Index For Dynamic Object Pairs

Hi @vsr1 ,

We have a below Query

SELECT d.pageMeta.general.*,
p.modifiedOn AS lastReplicatedDate,
p.slugUrl,
META(d).id AS _ID,
META(d).cas AS _CAS
FROM bucket AS d
JOIN bucket AS p ON (d.pageId = p.pageId)
WHERE ANY
AND EVERY f IN OBJECT_PAIRS({“name”:“value”}) SATISFIES d.c.b.[f.name] = f.val END
AND d.type = ‘something’
AND d.clientId = “something”
AND d.isStacked = FALSE
AND p.type= ‘someotherType’
AND p.clientId=“something”
ORDER BY p.modifiedOn DESC

p and d are two two different types of documents
the structure of d

d{
c{
b{
“name”:“value”,
“name_1”:“value_1”,
“name_2”:“value_2”
}
}
}

The call to object pairs can any value under b , can be single or multiple
Need a dynamic index for that. Number of docs : 2000
Currently the query is taking some 600ms.

https://index-advisor.couchbase.com/indexadvisor/#1