Query Plan Description ====================== Step 1: Process Organisation ($1) instances ------------------------------------------- [Step 1a] Scan type com.contextspace.datamodel.party.Organisation locating all the Organisation ($1) instances. [Step 1b] Evaluate fields in Organisation ($1) instances. Step 2: Process Attribute ($2) instances (for every result of step 1) ---------------------------------------- [Step 2a] Scan index com.contextspace.datamodel.attribute.Attribute[name] locating Attribute ($2) instances that satisfy: ($2.name='Attribute1'). [Step 2b] Scan index com.contextspace.datamodel.attribute.Attribute[valueAsString] locating Attribute ($2) instances that satisfy: ($2.valueAsString='1'). [Step 2c] Iterate over all the instances ($2) in $1.attributeList. [Step 2d] Order the results of step 2c by: $2. [Step 2e] Merge the results of steps 2a, 2b, 2d using AND. Step 3: Process Organisation ($3) instances (for every result tuple of the steps above) ------------------------------------------- Iterate over all the instances ($3) in $1.parentOrg. Step 4: Extract field values ---------------------------- Retrieve fields in Organisation ($3) instances. Step 5: Process Organisation ($4) instances (for every result tuple of the steps above) ------------------------------------------- [Step 5a] Iterate over all the instances ($4) in $3.parentOrg. [Step 5b] Retrieve fields in Organisation ($4) instances. [Step 5c] Filter the results of step 5b retaining only results that satisfy: or(($4.organisationId='root'),($3.organisationId='root')). Step 6: Group results --------------------- Group the results of step 5by: $1. [Step 7] Remove duplicates from the groups of step 6. [Step 8] Apply selection and prepare final results.