Loading TOC...


   $sql as xs:string,
   [$options as xs:string*]
) as element()


Returns a node representing the query plan of the given SQL SELECT query. Raises an error if the SQL query is not a SELECT query.

sql The SQL query to be executed.
options Options as a sequence of string values. Available options are:
Sets the optimization level to use. Levels of 0 (off), 1, and 2 are recognized. The default is 1.
Outputs an XML format query plan. This is the default.
Outputs a JSON format query plan. The default is "xml".

Required Privileges



xdmp:sql-plan("select  customername, customersince
from customers
where year(customersince)  >  2000
and year(customersince)  <  2013")

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.