Query Advisor

Query Advisor

Wondering how to optimize your queries? Query Advisor can assist. Based on a set of rules Capital One honed along their cloud journey; with a goal to eliminate as many inefficiencies as possible.

The Rules

Query Advisor analyzes your query by finding inefficiencies in the query’s structure, then bubbles up opportunities for improvement when they’re found.

Getting started with Query Advisor

Identify the most frequently executed queries and those incurring the highest costs by opting into Query Autoloading.. Evaluate and analyze them using Query Advisor. Costliest rankings are the sum of all query runs from the current month plus the last two months.

ℹ️
Query Advisor only supports and finds inefficiencies in Data Query Language (DQL) queries. Query Advisor does not support non-DQL queries or queries with special Snowflake.
  1. Manage your plan to activate Query Advisor’s autoloading feature.
  2. Select Opt in.
  3. View the costliest queries.
  4. Select Analyze to load the query text into Query Advisor. Make updates.
  5. To see Frequently run queries, go to Cost Insights > Cost analysis > Warehouse costs. Scroll down to Frequently run queries. You’re ready to optimize your queries!

Using Query Advisor

Simply paste your query into the Query Advisor and review the tips, if it finds any.

⚠️
The text isn’t saved. Be sure to copy or export the query before refreshing the page or visiting another area in Slingshot.
  1. Open Query Advisor by selecting it from the left navigation menu.

  2. Paste your query into the space provided.

  3. Use the Analyze query button.

  4. Opportunity(ies) appears to the right. Use the left and right arrows to see additional suggestions.

ℹ️
Hit Clear all to erase the current query text and enter a new queryto analyze.
  1. Update the Query in the Query Advisor.

  2. Analyze query, again.

  3. Everything looks great!

  4. You have two options. Use Copy to copy and paste the query into Snowflake; Or use the Export to generate an SQL file.

Want to learn more about optimizing Snowflake queries? Check out Simplify and Conquer: Guide to Writing Efficient Queries in Snowflake.