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.
- Manage your plan to activate Query Advisor’s autoloading feature.
- Select Opt in.
- View the costliest queries.
- Select Analyze to load the query text into Query Advisor. Make updates.
- 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.
Open Query Advisor by selecting it from the left navigation menu.
Paste your query into the space provided.
Use the Analyze query button.
Opportunity(ies) appears to the right. Use the left and right arrows to see additional suggestions.
Update the Query in the Query Advisor.
Analyze query, again.
Everything looks great!
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.