[XQuery] problem performances with the function <count&gt


I build a XQuery like you see below and this XQuery is exectuted through the Tamino API in .NET.

for exemple:

  • for $test in count(input()/Data[@Crit=10 and tf:containsText(Person/Name, ‘steve’)]) return {$test}


  • count(for $test in input()/Data[@Crit=10 and tf:containsText(Person/Name, ‘steve’)] return $test)

The execution of theses two Xquery request a lot of time with the function count(…) and are slower than without this function.

For information, i have a text-index on the element “Name” and standard-index on attribute “Crit” and the database contains about two thousands hundred records.

Is anyone know how I can improve the performance of the xquery to know the number of records in the database or it exists something else to know the number of records.

Thank your for help


First, a couple of points: