Equivalent XPath and cts:search expressions should perform the same. Can you share an example, and what version you are using?
If they are equivalent and there is a performance difference, then there may be a bug. Kelly Message: 5 Date: Thu, 12 May 2011 09:05:16 -0600 From: "seme...@hotmail.com" <seme...@hotmail.com> Subject: [MarkLogic Dev General] Why is cts:search so much faster than XPath? To: <general@developer.marklogic.com> Message-ID: <snt121-w423bd38403eb7f1aded8d5b7...@phx.gbl> Content-Type: text/plain; charset="iso-8859-1" I wrote awhile ago that I thought it was usually best to use search:search for full text searching, cts:search for node selection out of the db, and XPath for node selection within a document. I just ran into a situation that doing the same query for nodes in the DB using cts:search was 6 times faster than using XPath. So what is it about cts:search that makes it so fast? I assume that there are optimizations under the covers, but how is cts:search able to gain from the optimizations but XPath is not? Just curious. -Ryan _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general