![]() | ![]() | contents |
@Explain — Returns the execution plan for the specified SQL query.
ClientResponse client.callProcedure("@Explain", String SQL-statement)
The @Explain system procedure evaluates the specified SQL query and returns the resulting execution plan. Execution, or explain, plans describe how VoltDB expects to execute the query at runtime, including what indexes are used, the order the tables are joined, and so on. Execution plans are useful for identifying performance issues in query design. See the chapter on execution plans in the VoltDB Performance Guide for information on how to interpret the plans.
Returns one VoltTable with one row and one column.
| Name | Datatype | Description |
|---|---|---|
| EXECUTION_PLAN | VARCHAR | The execution plan as text. |
The following example uses @Explain to evaluate an ad hoc SQL SELECT statement against the voter sample application.
try {
String query = "SELECT COUNT(*) FROM CONTESTANTS;";
VoltTable[] results = client.callProcedure("@Explain",
query ).getResults();
System.out.printf("Query: %d\nPlan:\n%d",
query, results[0].fetchRow(0).getString(0));
}
catch (Exception e) {
e.printStackTrace();
}
The Tao of VoltDB
The 5 Principles of VoltDB
VoltDB Technosphere
Products and Solutions
Technical Support
Key Features
Download VoltDB
No Limits
VoltDB Application Gallery
Infinite Possibilities
VoltBuilder Program
