<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.queryTrace.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.queryTrace</api:function-name><api:suggest>xdmp.querytrace</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>querytrace</api:suggest><api:function-link mode="xquery" fullname="xdmp:query-trace">/apidoc/8.0/xdmp:query-trace.xml</api:function-link><api:function mode="javascript" name="queryTrace" type="builtin" lib="xdmp" category="Extension" subcategory="MarkLogic Server" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.queryTrace"><api:summary>
  Enables or disables tracing of this query.
  When query tracing is enabled, "info" level messages
  are logged detailing the search optimizations performed.
</api:summary><api:params><api:param name="enabled" type="xs:boolean"><api:param-description>
    Specify true to enable query tracing, false to disenable query tracing.
  </api:param-description><api:param-name>enabled</api:param-name><api:param-type>Boolean</api:param-type></api:param></api:params><api:return>null</api:return><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">Search optimizations are performed in three phases:</p>
  <blockquote xmlns="http://www.w3.org/1999/xhtml">
  <dl>
  <dt>the path analysis phase</dt>
  <dd>In this phase a path expression is analyzed to determine whether
  it can be executed in whole or in part through an optimized search.
  Each individual component of the path is analyzed to see if it is
  searchable.  The searchablity of each path component is logged.</dd>
  <dt>the search constraint gathering phase</dt>
  <dd>In this phase, search constraints are gathered from the path
  expression components. The number of constraints contributed by
  each path component is logged.</dd>
  <dt>the search execution phase</dt>
  <dd>In this phase, a search is performed using the gathered constraints.
   The actual number of fragments selected for filtering is logged.</dd>
  </dl>
  </blockquote>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.queryTrace(true);
=&gt; ()
</pre></api:example></api:function></api:function-page>