33 lines
1.1 KiB
MySQL
33 lines
1.1 KiB
MySQL
|
-- top 10 des requ<71>tes les plus pourries
|
|||
|
SELECT TOP 10
|
|||
|
SUBSTRING(text,
|
|||
|
(statement_start_offset/2) + 1,
|
|||
|
((CASE statement_end_offset
|
|||
|
WHEN -1 THEN DATALENGTH(text)
|
|||
|
ELSE statement_end_offset
|
|||
|
END - statement_start_offset)/2) + 1)
|
|||
|
AS QUERY,
|
|||
|
*
|
|||
|
FROM sys.dm_exec_query_stats
|
|||
|
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
|
|||
|
CROSS APPLY sys.dm_exec_query_plan(plan_handle);
|
|||
|
GO
|
|||
|
|
|||
|
-- top 10 des proc<6F>dures les plus pourries
|
|||
|
SELECT *
|
|||
|
FROM sys.dm_exec_procedure_stats
|
|||
|
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
|
|||
|
CROSS APPLY sys.dm_exec_query_plan(plan_handle);
|
|||
|
|
|||
|
-- top 10 des d<>clencheurs les plus pourries
|
|||
|
SELECT *
|
|||
|
FROM sys.dm_exec_trigger_stats
|
|||
|
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
|
|||
|
CROSS APPLY sys.dm_exec_query_plan(plan_handle);
|
|||
|
|
|||
|
-- top 10 des UDF les plus pourries
|
|||
|
SELECT *
|
|||
|
FROM sys.dm_exec_function_stats
|
|||
|
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
|
|||
|
CROSS APPLY sys.dm_exec_query_plan(plan_handle);
|