N1QL - JOIN Query

Hi Team,
Need some pointer to optimize the query. We have 2 documents to be joined . we need to get the Id for Doc1 and Status from Doc2. as of now our query is below, IF WE HAVE ANY SPECIFIC INDEX CREATION FOR THIS ALSO really helps.
SELECT DISTINCT META(td).id,
ms.Status
FROM XXXX AS td
JOIN XXX AS ms ON KEYS ‘TxStatus::’||TOSTRING(META(td).id)
WHERE td.$Type = ‘AcctDefect’
AND td.$MdfdTmstmp BETWEEN ‘2021-05-18T12:05:02.187Z’ AND ‘2021-05-18T13:05:02.187Z’
AND ms.$Type = ‘TxStatus’
Doc1:
{
“Id”: “AcctDefect::a9e3b2d5-27a0-4a31-b1cb-b63d355d54ed”,
“Lvl1NodeNum”: “03”,
“$MdfdTmstmp”: “2021-04-26T12:00:00.000-05:00”,
}
Doc2:
{
“Status”: “COMPLETED”,
“DocId”: “AcctDefect::a9e3b2d5-27a0-4a31-b1cb-b63d355d54ed”,
“$MdfdTmstmp”: “2021-04-29T12:02:28.280Z”,
“Id”: “TxStatus::AcctDefect::a9e3b2d5-27a0-4a31-b1cb-b63d355d54ed”,
“$Type”: “TxStatus”,
“DocType”: “AcctDefect”,
}

CREATE INDEX ix1 ON XXXX( `$MdfdTmstmp`) WHERE `$Type` = "AcctDefect";

SELECT META(td).id, ms.Status
FROM `XXXX` AS td
JOIN `XXX` AS ms ON KEYS ‘TxStatus::’||TOSTRING(META(td).id)
WHERE td. `$Type` = ‘AcctDefect’
AND td. `$MdfdTmstmp` BETWEEN ‘2021-05-18T12:05:02.187Z’ AND ‘2021-05-18T13:05:02.187Z’
AND ms. `$Type` = ‘TxStatus’