I already posted question here but I have some issues. I have two buckets “temp” and “temp1” in “temp1” buckets I have thousands of documents and in each documents I have structure as like below
{
"data":["ID","ID1","ID2",...."ID10000"]
},
{
"data":["ID","ID1","ID2",...."ID10000"]
},
{
"data":["ID","ID1","ID2",...."ID10000"]
}
This “data” array contains ten thousand of ids stored and that ids in string format. And same way I have data in “temp” buckets as below
{
"user_ID":"A1",
"data":["ID","ID1","ID2",...."ID10000"]
},
{
"user_ID":"A2",
"data":["ID","ID1","ID2",...."ID10000"]
},
{
"user_ID":"A3",
"data":["ID","ID1","ID2",...."ID10000"]
}
and I want to check if any of “ID” from “temp1.data” present in “temp.data” then return matched documents “user_ID” from “temp” buckets so my expected output as below
["A1","A2",...] etc.
This two buckets don’t have any relation ship between them. If I run query mentioned in previous question like this
SELECT ARRAY_INTERSECT(t.data, t1.data) FROM temp t UNNEST (SELECT RAW temp1 FROM temp1) AS t1;
but it takes too much time to execute query and after some minutes it show query time out exception.