Hi,
I'm currently testing baseX and wondering how one should use databases/collections.
I did some testing with the live demo and Query 6:
for $pub in doc('dblp')/dblp/*
where $pub/author = 'Alexander Holupirek'
return $pub/title
First I was wondering where "in collection" is. Tried it on my local testmachine with "in collection" and several other of my testdocuments in the same collection/database and the query took more than 10 seconds compared to 100ms in the live demo!
Then I found out that you don't need "in collection" if you have just one document in the database. So I dropped all other documents and tried it again: This time the query took 38ms!
Is this intended or am I doing something wrong? When should you use collections/databases?
Are there any hints or best practices how to organize data to get efficient queries?
Krind regards,
Stefan