Hi ,
We have a below document and we would like to create an index for this, we want only the active CustRteRltnshps records.
{
“Id”: “XXXX::1000003_157_01”,
“$Type”: “XXXX”,
“CtryCd”: “mmm”,
“CustRteRltnshps”: [
{
“CtryCd”: “YYY”,
“RteDocId”: “ZZZZ::YYYYY_XXX”,
“RltnshpTypCdv”: “01”,
“RteID”: “XXXX”,
“EffDtRnge”: {
“EndDt”: “9999-12-25”,
“StrtDt”: “2012-03-11”
}
}
]
}
Our Current query is,
select a.CtryCd, rte.RteID, rte.CtryCd as rtctrycd, rte.EffDtRnge.StrtDt, rte.EffDtRnge.EndDt FROM masterdata-target
a unnest CustRteRltnshps rte
WHERE a.$Type
= ‘Customer’
AND rte.EffDtRnge.StrtDt <= CLOCK_LOCAL()
AND rte.EffDtRnge.EndDt >= CLOCK_LOCAL()
Explain gives only $Type index creation. Any possible solution?
Thanks