Reputation: 1510
We are developing an enterprise application which store huge amount of data. In our application we forced the user to create multiple Path Range Indexes to make search faster.
Earlier we were taking advantage of Path Range Indexes to make search faster using cts:path-range-query() but now I found that same result I can get using cts:element-query() without creating Path Range Indexes.
For Example -
Using cts:path-range-query() -> Here I need to create Path Range Index for /tXML/Message/INVENTORY/ASNId
xquery version "1.0-ml";
cts:uris('', (), cts:and-query((cts:collection-query("integration"),
cts:path-range-query("/tXML/Message/INVENTORY/ASNId", "=", "10121600"))))
Using cts:element-query() -> Here I dont need Create Path Range Index.
xquery version "1.0-ml";
cts:uris('', (), cts:and-query((cts:collection-query("integration"),
cts:element-query(xs:QName("tXML"),cts:element-query(xs:QName("Message"), cts:element-query(xs:QName("INVENTORY"), cts:element-value-query(xs:QName("ASNId"), "10121600")))))))
My questions are,
If I am getting the same result as cts:path-range-query() using cts:element-query() then why do I need to force the user to create Path Range Indexes ?.
which query is suitable for huge set of data ?.(cts:element-query() or cts:path-range-query())
Please help me to find answers of these two questions.
Upvotes: 4
Views: 349
Reputation: 20414
The answer is not entirely straight-forward, meaning that results might vary depending on data, and volume.
A couple of notes though:
HTH!
Upvotes: 5