Hi Christian,
Thanks for the quick response, and sure thing. It does look like the text index is applied in both cases. While I was writing up an example of the slow query, I realized that the way I'll actually be querying it is by wrapping the condition in not(...). After doing so, it now only takes 6 seconds to run -- still slower but better. The slow query looks like this:
for $x in db:open('MyDatabase')/data/element
where not($x/child1/child2/valid = 'false')
return $x
And the fast query looks like this:
for $x in db:open('MyDatabase')/data/element
where $x/child3/child4/id = '123'
return $x
Let me know if this is helpful -- if not, I could share more info in a direct email about the actual structure of the database and the Info output.
Thanks,
Matt