Análisis de rendimiento en consultas MS Sql Server

Pequeño script para analizar rendimiento de consultas

SELECT [Metodo],Max([Tiempo]),SUM([Tiempo]), Count(*)
  FROM [MiDb].[dbo].[optimizacion]
  Group by [Metodo]
  Having Max([Tiempo]) > 0 and SUM([Tiempo]) > Max([Tiempo])
  order by Max([Tiempo]) desc;

SELECT [Metodo],Count(*)
  FROM [MiDb].[dbo].[optimizacion]
  group by [Metodo]
  having Count(*)>1
  order by Count(*) desc;

-- CacheData.IncidenciaGetAll Corregir cache
-- Especifico
SELECT * FROM [MiDb].[dbo].[optimizacion]
where [Metodo] = 'CacheData.IncidenciaGetAll';

Leave a Reply

Your email address will not be published. Required fields are marked *