Working with query plans in MC
Management Console can show you a query plan in easy-to-read format, where you can review the optimizer's strategy for executing a specific query. You can view a query plan in either of two ways:
-
View the plan of an active query.
-
View the plan for any query that you manually specify.
Access the plan of an active query
-
At the bottom of the Management Console window, click the Activity tab.
-
From the list at the top of the page, select Queries.
-
On the activity graph, click the data point that corresponds to the query you want to view.
-
In the View Plan column, click Explain next to the command for which you want to view the query plan. Only certain queries use query plans—for example, SELECT, INSERT, DELETE, and UPDATE.
-
In the Explain Plan window, click Explain. Vertica generates the query plan.
-
(Optional) View the output in Path Information view or Tree Path view. To do so, click the respective view buttons on the left of the output box.
Access the plan for a specific query
-
Locate the query for which you want to see the query plan in either of the following ways:
-
Queries Not Running — In the Explain window, type or paste the query text into the text box.
-
Queries Currently Running — In the Find a Query By ID input window, perform one of the following actions:
-
Enter the query statement and transaction ID.
-
Click the Browse Running Queries link.
-
Caution
Entering the word EXPLAIN before the query results in a syntax error. -
-
Click Explain. Vertica generates the plan.
If the query is invalid, Management Console highlights in red the parts of your query that might have caused a syntax error. -
(Optional) View the output in Path Information view or Tree Path view. To do so, click the respective view buttons on the left of the output box.