xdmp.sqlPlan( sql as String, [options as String[]] ) as ObjectNode
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.
http://marklogic.com/xdmp/privileges/xdmp-sql
xdmp.sqlPlan("select customername, customersince\n\ from customers\n\ where year(customersince) > 2000\n\ and year(customersince) < 2013")
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.