-
Notifications
You must be signed in to change notification settings - Fork 7
Examples
Using the sp_WhatsupQueryStore stored procedure is very easy! Just to get you started with using it, here are some examples:
EXEC sp_WhatsupQueryStore @dbname='database name', @return_all=1
By running the command above, sp_WhatsupQueryStore will return all information windows for the database 'database name'. Returning all the information sp_WhatsupQueryStore can grab from the Query Store can take some time depending on the size and activity of the Query Store you are running it against.
EXEC sp_WhatsupQueryStore @dbname='database name', @timewindow=4, @topqueries=10, @return_top_duration=1
This query limits the information returned to only the top 10 queries based on average duration executed in the last 4 hours.
EXEC sp_WhatsupQueryStore @dbname='database name', @timewindow=2, @return_forced_plans=1, @return_multiple_plans=1
This query will return all the forced execution plans as well as all the queries that generated multiple execution plans in the last 2 hours.