typedb
typedb copied to clipboard
Create query profiler
Problem to Solve
It is currently not possible to know how many rules have been analysed and used for a given query. Also there is no way to know how many nodes and edges have been traversed during a query execution.
Current Workaround
N/A
Proposed Solution
Create a QueryProfiler that collects data about every executed query:
- how many nodes(how many reads, may be differentiate cached and not cached) it touched during an execution
- how many inference rules it checked (if by execution it needed to recheck rules, they should be added to count)
- how many inference rules it executed
The collected statistics should be returned together with map and explanation in the Answer. The profiler should be used only when a specific flag is enabled (as it will probably impact on performance)