Optimizing a query in Hue

You can use the SQL AI Assistant to optimize a SQL query. Hue identifies the issues in the source query, optimizes it, and provides the optimized version of the SQL query. Hue also summarizes the issues and how it optimized the query in natural language.

Your administrator must have configured and set up the required infrastructure for you to use the SQL AI Assistant. See About setting up the Hue SQL AI Assistant.
  1. Log in to the Data Warehouse service as DWUser.
  2. Open Hue corresponding to your Virtual Warehouse.
  3. Insert a SQL query in the Hue editor that you would like to optimize.
  4. Click Assistant on the Hue SQL editor:
    Screenshot showing how to launch the SQL AI Assistant from the Hue web interface.
  5. Click OPTIMIZE.
    Screenshot showing how to use the SQL AI Assistant in Hue to optimize a SQL query.
    Hue displays the original and the optimized SQL query side-by-side. It also provides an explanation of the issues in the original query and how it was optimized.
    Screenshot showing the original and the optimized SQL query generated using SQL AI Assistant in Hue along with an explanation.