as you can see, I tried to use multipath index on attribute “id”, which case make the second query use the index. I also have been able to create a index on “Div” to make the 4th query to use the index on attribute “id”.
However, no matter what index I created, the 3rd query just don’t use the index on attribute “id”
I actually simplify a real schema I used to this one. You can still just define this schema
against a temp collection. I have created multipath index on “div”, “id”, and even “note”,
with this schema,
/div[@id]/note ----- use the index “id”
//div[@id]/note------ use the index “id”
//div[@id]//note and /div[@id]//note don’t use the index “id”
some how, in my real schema, //div[@id]//note works. anyway, how can we
make the two queries to use the index on “id”
the scenario I have is : many users will update the documents in a collection at the same time using queries in above format, if Tamino doesn’t use the index, then it will lock the whole
doctype when a user update a document, preventing others to update different document at the same time.
why do you think that no index is being used?
If you are using _xql=ino:explain(…,“tree”) you’ll see, that indexes
are being used for both queries
//div[@id=“myId”]/note
and
//div[@id=“myId”]//note
if the doctype does already contain documents contributing to the indexes.
This restriction is related to the special nature of multiPath indexes.
thanks for checking out that for me. However, I did have document in my doctype, and I also used the “explain” button in “inoxplorer” for the xquery I used.
//div[@id=“ab”]//note
and
/div[@id=“ab”]//note
don’t use index.
I posted 4 screenshot for you. 1.jpg and 2.jpg are the screen for the two queries not using index. Success.jpg is for the query using the index. And file.jpg is the file I have in under my doctype.