I have a soap query where i am attempting to get a list of computer names based upon a list of user names. The relevance language I am using takes quite a while to return (30 or so second). Is there a way to optimize the relevance query?
The query I am using is below ( I am forcing all the users to be lower case because my list is mixed case).
names of bes computers whose ((value of result from (bes property whose (name of it is “User Name”)) of it) of it is “” . lc($user) . “”)"
The bottleneck with this expression is in the whose loop. Basically, every time you check a computer, you go through all the bes properties to find the username property. We can optimize this expression by looking up the property first and then just referencing it for each computer:
names of (item 1 of it) of (it, bes computers) whose ((value of result (item 0 of it, item 1 of it ) ) contains “”) of bes property whose (name of it is “User Name”)