Last active
October 21, 2015 13:34
-
-
Save robsonalves/c0b4ba485ac5283251a0 to your computer and use it in GitHub Desktop.
Encontrar Falta de Indices e Conversão Implicita
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET TRANSACTION isolation level READ uncommitted | |
SELECT TOP 20 ST.text AS [PARENT QUERY], | |
Db_name(ST.dbid) AS [ DATABASENAME ], | |
CP.usecounts AS [USAGE COUNT], | |
QP.query_plan | |
FROM sys.dm_exec_cached_plans CP | |
CROSS apply sys.Dm_exec_sql_text(CP.plan_handle) ST | |
CROSS apply sys.Dm_exec_query_plan(CP.plan_handle) QP | |
WHERE Cast(QP.query_plan AS NVARCHAR(max)) LIKE '%<MissingIndexes>%' or | |
Cast(QP.query_plan AS NVARCHAR(max)) LIKE '%CONVERT_IMPLICIT%' | |
AND db_name(st.dbid) = 'Piloto' | |
ORDER BY CP.usecounts DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment