Quip 2.2.1.1 Performance issue

I have run into a rather drastic performance issue in trying to build an XQuery join using a Quip Query.

I originally built this query using test data (2 records on the nomination document and 3 records on the employee document) and the query functioned as expected.

Now I am running my saved query against production data (in this case 2 nomination records and 18,000+ employee records) and the query will not complete within the QuipGUI as it ends up occupying too much memory, and time.

Both documents are stored in Tamino as structured XML with indexes in the appropriate locations.

Here is my query:


{
for $x in collection(“Peak”)/employee
for $y in collection(“Peak”)/nomination

where $x/@pid=$y/nominee
return

{$y/@ino:id,$y/@nom_id}

{$x/@pid,$x/*}

{$y/creation_date}
{$y/creation_date,$y/approver,$y/approval_date,$y/desc,$y/attrib}

}