I have 2 schemes in tamino 4.2, both have 230.000 documents, when attempt to execute a XQuery with a join between this schemes wich have a 9300 doc of result the XQuery it takes 0.125 seg , wich is ok but when attempt to do the same XQuery with count() it takes 23 seg :shock: wich is very very bad!!! what is the problem with count() an joins? is this a bug of Tamino 4.2 ?? :?:
these are the XQuerys:
1. for $a in input()/Paciente
where (($a/DatosPersonales/ApellidoPat=‘GONZALEZ’ or $a/DatosPersonales/ApellidoPat=‘PEREZ’ or $a/DatosPersonales/ApellidoPat=‘LOPEZ’) and (for $b in input()/Paciente2 where $a/DatosPersonales/Run=$b/DatosPersonales/Run return ))
return $a0.125 seg in get the result .
2. count(for $a in input()/Paciente
where (($a/DatosPersonales/ApellidoPat=‘GONZALEZ’ or $a/DatosPersonales/ApellidoPat=‘PEREZ’ or $a/DatosPersonales/ApellidoPat=‘LOPEZ’) and (for $b in input()/Paciente2 where $a/DatosPersonales/Run=$b/DatosPersonales/Run return ))
return $a)23 seg :shock: :?:
if is the same XQuery with only the count() diference then what is problem with Tamino?
The provided schemas do not define any Paciente2 doctype, to reproduce the problem I also need this schema.
I’ve done some testing by removing the “2” from the Paciente2 doctype name, but the explain output of the modified queries didn’t show any difference that could explain the big difference in the execution time. So, in addition to the complete set of involved schemas I would like to have the explain output of the two queries.
Hi, these are three schemas “Paciente”,“Paciente2” and “Comuna”, the only difference between “Paciente2” and “Paciente” if the name of the root node both schemas have the same structure. and the same data.
When I’m comparing the explain output for both queries compiled against the schemas I don’t see any big difference. It would be really helpful if you could send me your explain output.