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