VoltDB Home » Documentation » Using VoltDB


@ExplainView — Returns the execution plans for the components of the specified view.


@ExplainView String view-name


The @ExplainView system procedure returns the execution plans for certain components of the specified view. Execution plans describe how VoltDB expects to calculate the component values as the referenced tables or streams are updated. The plans include what indexes are used, the order the tables are joined, and so on. Execution plans are useful for identifying performance issues in the design of the view statement. See the chapter on execution plans in the VoltDB Guide to Performance and Customization for information on how to interpret the plans.

For views, execution plans are listed for the calculation of MIN() and MAX() functions and multi-table joins only. For simple views — that is, views on a single table with aggregate functions other than MIN() or MAX() — the system procedure returns no rows.

Return Values

Returns one VoltTable with one row for each component of the view.

TASKVARCHARThe function or join statement
EXECUTION_PLANVARCHARThe execution plan as text.


The following example uses @ExplainView to evaluate the execution plans associated with a view that joins two tables.

try {
    VoltTable[] results = client.callProcedure("@ExplainView",
       "stats_by_city_and_state" ).getResults();
    while (results[0].advanceRow()) {
         System.out.printf("Task: %d\nPlan:\n%d",
catch (Exception e) {

In the sqlcmd utility, the "explainview" command is a shortcut for "exec @ExplainView". So the following two commands are equivalent:

$ sqlcmd
1> exec @ExplainView 'stats_by_city_and_state';
2> explainview stats_by_city_and_state;