One of the places that we struggle with the most is understanding query performance. In general we get the idea that in order to write a fast query you need to reduce the search space as quickly as possible. As a result the most specific datalog clause should go first. However, we have found cases when that is not always true. For example when an attribute is a reference or when an attribute is indexed. Since we have little insight into how the query planner works its hard for us to tell what will make a query fast. We can and do optimize our queries by hand. But as our system grows and we add more queries this hand optimization becomes more burdensome. It would be great to have a tool, similar to a sql explain, that would give us the fastest ordering of the datalog clauses and provide suggestions for adding indexes.