MarkLogic provides a possibility to see how the given search expression will be processed by the index. XQuery function xdmp:plan is responsible for that – https://docs.marklogic.com/xdmp:plan
The way it works is perfectly described here – https://www.marklogic.com/blog/working-with-xdmp-plan/
Sort of depends on what you are doing. But there is probably tooling in this list to match your needs depending on what you are using for your implemntation:
Returns a node representing the query plan of the given SQL SELECT query.
Return a node representing the query plan of the given SPARQL query.
This method returns a representation of the builtin execution plan.
- could only find xquery doc link