Managing Queries 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

  1. At the bottom of the Management Console window, click the Activity tab.

  2. From the list at the top of the page, select Queries.

  3. On the activity graph, click the data point that corresponds to the query you want to view.

  4. 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.

  5. In the Explain Plan window, click Explain. Vertica generates the query plan.
  6. (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

  1. 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.

    Entering the word EXPLAIN before the query results in a syntax error.

  2. 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.
  3. (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.