Hi Ankit,
Now the problem is that, It is working fine with this, but when I declare variable $ids as xs:string* sequence.
The reason is the existence of the Java function: We cannot always determine statically what types the results will have. As a result, we cannot statically detect that $ids will always be a sequence of strings, and as a result, your path expression cannot be rewritten to an index request. Generally, it's always recommendable to explicitly specify type information in your query; it will improve performance in many cases.
A reminder: Check out the compilation steps in the info view, they will give you insights how your query will be compiled.
Christian
It performance is decreased by almost
100%. It looks like this.
let $ids as xs:string* := javacontext:getIds(); // Java Method return /sample_xml/category/product[@id = $ids]
But, for bigger no of products, and ids . when the variable $ids declared as xs:string*, it is working good, but when I removed xs:string*. it performance decreased drammatically.
I have no idea, why it is working in such a way. Any kind of help is appreciated.
Thanks, Ankit