xtdb
xtdb copied to clipboard
Making it easier for users to retrieve and submit query plans for ill-performing queries
One of the first questions we often ask users with query performance issues is to get us the debug logging for crux.query, which contains the attribute stats and join order - let's see if we can make it easier for users to get hold of.
Some ideas:
- We could make this a semi-internal API, no guarantees about the return format
- Setting the
:explain?flag on the query dumps the query, relevant attribute stats and join order to stderr? - Returning explain plans as metadata on query results?
- We could obfuscate the attribute names (and anything else sensitive in the query?), maybe a separate flag?
Noting that users can currently call xtdb.query/query-plan-for directly https://github.com/xtdb/xtdb/blob/1454e1ffed7511a1e701e86d373e1fea8a748214/core/src/xtdb/query.clj#L1822