Hi. Hoping one of you can point me in the right direction here, or at
least check my conclusions.

We have this query which tends to run about 10x faster on our development
environments ("cluster" with single MarkLogic server) than on our
production environment (multiple-server cluster). Trying to track down the
cause of the slowness using query-meters(), I'm seeing output like:

<qm:host>
      <qm:host-name>HOST003</qm:host-name>
      <qm:round-trip-count>2065</qm:round-trip-count>
      <qm:round-trip-time>PT0.732573S</qm:round-trip-time>
    </qm:host>
Š
(2x more hosts)

(On a single-server setup, the entire qm:host output is missing,
presumably because no inter-server traffic is required to answer the
query).

I'm not entirely sure how to interpret this output ­ particularly, I'm not
sure what round-trip-time is measuring.

Some possible approaches we thought of:
* Ensuring that we're using indexes, "unfiltered" in searches whenever
possible. (It looks like high round-trip-count values correspond to such
things as numerous doc() calls, large filtered searches, etc)
* Is there some way to hint to MarkLogic about spanning fewer servers
during query execution?
* Anything else I should look at?

A simplified query I wrote to replicate the problem (needs, say,
10000-100000 documents in MarkLogic to work) is below.

Thanks,

Tim S
(Software Engineer, BBC)

Example script:
xquery version "1.0-ml";

(: This runs in a fraction-of-a-second on data sets we're using for this
project. YMMV. :)
declare function local:large-unfiltered-query($baseUri) {
  cts:search(xdmp:directory-properties($baseUri, "infinity"),
cts:and-query(()), "unfiltered")
};

(: High count means longer execution time, and high round-trip-count :)
let $count := 10000

let $ignore :=
  let $bar := local:large-unfiltered-query("/")
  for $doc in $bar[0 to $count]
    let $retrieved := doc(document-uri($doc))
    return "" 
return xdmp:query-meters()

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to