From: Wolfgang <wol...@ex...> - 2008-04-03 15:43:38
|
Hi, There can't be a difference between elements and attributes concerning indexes and performance. Both are handled in exactly the same way. There must be another reason for the differences you see. Please try to avoid "where" expressions: eXist's new query-rewriting optimizer cannot handle them yet and you will thus not benefit from our new optimizations! Most simple where expressions can be rewritten into a predicate: > declare function hr:id($id) as xs:integer { > for $c in $id > where $c/@name = "id" > return $c > }; becomes declare function hr:id($id) as xs:integer { for $c in $id[@name = "id"] return $c }; The "where" is pretty useless here. Wolfgang |