x-query max() function problem - No index usage

Tamino X-Query’s max() function don’t use index. For example, I made index on /CUSTOMER/ID tag. After then I query with “max(/CUSTOMER/ID)”. But Tamino don’t use index on “ID” tag. It uses postprocessing. I could find it by using ino:explain(max(/CUSTOMER/ID)). This occurs serious performance problem. Is there any way to use index with Tamino functions?

I am not sure but I think that builtin (maybe not all) and user defined functions are not able to use indeces at all. Tamino calculates arguments and passes result nodeset to external code. This code scans the nodeset and retrieves max value.

As a workaround you could modify your query.

_xql(1,1)=CUSTOMER sortby(ID desc)/ID

This will be certainly faster.

[This message was edited by Alexander on 10 Oct 2002 at 09:13.]

or _xql(1,1)=CUSTOMER/ID sortall (. desc)