Hi,

  We are having millions of records in db.Now i want to query the entire
database based on few filters.For example,

i am having  "/test/book1.xml","/test/book2.xml","/test/book3.xml" ...
"/test/bookn.xml"


<book>
  <title>New Book</title>
  <Author>Auth X</Author>
  <price>100</price>
</book>


 Now i have to fetch the count of uris whose title is "New Book" and
price=100.I tried with cts:search and cts:uris which gives me the same
result. But i would like to know on performance side which is the best
approach.

count(cts:search(/book,cts:and-query((cts:element-value-query(xs:QName("title"),"New
Book"),cts:element-value-query(xs:QName("price"),"100")
      ,cts:directory-query("/localhost/")
      )))
)
count(cts:uris('',(),cts:and-query((cts:element-value-query(xs:QName("title"),"New
Book"),cts:element-value-query(xs:QName("price"),"100")
      ,cts:directory-query("/localhost/")
      )))
)
In profiling i found the number expression executed for cts:uris is
less.Please suggest which is the best approach when we apply the
cts:document-query,cts:and-query .
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to