Hello,
I have two schemas Appointments and Patient. I run a join query between these two schemas and the response is very slow.
Appointment schema has about 20 documents and a standard index on Registration and UserCode fields.
Patient schema has about 40000 documents and a standard index on @Registration
I dont understand why query is so slow since I have all required indexes.
My query is like this and runs very slow :
for $a in input()/Appointments , $b in input()/Patient
where $a/Registration = $b/@Registration
and $a/UserCode = “msa”
return
{ $b/ID/Name} { $b/ID/Surname} { $a/Registration} { $a/StartDate} { $a/EndDate} { $a/Subject}
Some Other Interesting Notes :
This query also runs very slow (about 8 minutes) :for $a in input()/Appointments , $b in input()/Patient
where $a/Registration = $b/@Registration
and $a/UserCode = “msa”
return
$a
This query runs very fast : (less than 1 second)
for $a in input()/Appointments , $b in input()/Patient
where $a/Registration = $b/@Registration
and $a/UserCode = “msa”
return
$b/ID/Name
I am sending the Tamino request log as an attachment in case it may help
Tamino.AAC.log.1.xml (6.78 KB)