#expandItemWhereCount
UNION{ SELECT ?Order_s (COUNT(DISTINCT ?OrderhasOrderDetail_s) as ?OrderhasOrderDetail_count)
This seems to perfom much better:
#expandItemWhereCount
{ SELECT ?Order_s (COUNT(DISTINCT ?OrderhasOrderDetail_s) as ?OrderhasOrderDetail_count)
The UNION is not necessary as it is grouped with a select of properties of that which is being counted
Currently:
This seems to perfom much better: