Slow query

i have query

declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction
let $c := (for $a in input()/poslovni_oglasnik where $a/stanje=“objava” and ($a/rubrika/opcija=‘Natjecaji’ )
return
<poslovni_oglasnik>
{ $a/* }
{ tf:getDocname($a/…)}
{tf:getLastModified($a/…)}
</poslovni_oglasnik>
sort by (datum descending) )
[position()<= 10 ] return $c

indexes ar on $a/stanje and $a/rubrika/opcije

when i try to execute it it craches tamino database
it had worked nicely while i have small number of documents, but I have recently transferd about 17000 documents and from then it crashes

When ia try

declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction
let $c := (for $a in input()/poslovni_oglasnik where $a/stanje=“objava” and ($a/rubrika/opcija=‘Natjecaji’ )
return $a)
[position()<= 10 ] return $c

query tooks about 1 minute.

What could be a problem?

Thanks in advance!

Vedran

Hello,
Please report the Tamino crash to your local Software AG Customer Support Centre. They will need to know which version of Tamino you are using, and on which platform.
Thanks