Tamino performance 2

Hi.

As it is possible to raise productivity of inquiry ?

for $AccountUser in input()/so/ACCOUNTUSER, $SystemModule in input()/so/SYSTEMMODULE sort by (ACCOUNT_ID)
where $SystemModule/SYSTEM_ID = $AccountUser/SYSTEM_ID and $SystemModule/CLIENT_ID = $AccountUser/CLIENT_ID and $AccountUser/CLIENT_ID=1 return …

what indexes I should make ?

Hi,

You have two join predicates, one search predicate and one sort criteria.
I would suggest to put a (standard) index on all elements referenced by the predicates and the sort criteria. This means an index on the following element would increase the performance of your query:

/so/SYSTEMMODULE/ACCOUNT_ID
/so/SYSTEMMODULE/SYSTEM_ID
/so/SYSTEMMODULE/CLIENT_ID
/so/ACCOUNTUSER/SYSTEM_ID
/so/ACCOUNTUSER/CLIENT_ID

Best Regards,

Thorsten