Explaining AQL queries the fancier way
I have been looking at many AQL queries during the last few weeks…
Looking back, I can say that the JSON query execution plans provided by the
explain() method have provided me with a lot of useful information about how the AQL optimizer had transformed a given query. This has helped testing and improving the query optimizer a great deal.
However, the JSON output produced by
explain() is so detailed that even for the simplest cases queries it will span multiple screens. This is far too much for quickly assessing what a query will be doing and how it will be executed.
I therefore quickly put together a function that provides a much more compact explain output. Its input parameter is a query string, which it will send to the ArangoDB server to have it explained.
But it doesn’t print a voluminous JSON object. This one is for developers with a full schedule.
Get the latest tutorials, blog posts and news: