As disclosed herein a method, executed by a computer, for enabling a SPARQL explain tool that provides query execution statistics via an explain plan includes initiating a database query comprising a SPARQL query pattern, optimizing the database query according to query semantics and database metadata to produce an optimized query, and generating an explain plan for the optimized query. The explain plan may include a sequence of operations and an execution time, an input, and an output for each operation of the sequence of operations. A computer system, and a computer program product corresponding to the method are also disclosed herein.