SQL 查看SQL语句的执行时间 直接有效的方法
时间:2021-07-01 10:21:17
帮助过:3人阅读
STATISTICS PROFILE
ON;
SET STATISTICS IO
ON;
SET STATISTICS TIME
ON;
GO
/*--你的SQL脚本开始*/
SELECT [GroupBy1].
[A1] AS [C1]
FROM (
SELECT COUNT(
1)
AS [A1]
FROM [dbo].
[Questions] AS [Extent1]
WHERE (
[Extent1].
[CheckUser] IS NOT NULL )
AND (
NOT ( ( N
‘‘ = [Extent1].
[CheckUser] )
AND (
[Extent1].
[CheckUser] IS NOT NULL )
)
)
AND (
[Extent1].
[Source] IN ( N
‘xxx1‘, N
‘xxx2‘, N
‘xxx3‘ ) )
AND (
[Extent1].
[Source] IS NOT NULL )
) AS [GroupBy1];
/*你的SQL脚本结束*/
GO
SET STATISTICS PROFILE
OFF;
SET STATISTICS IO
OFF;
SET STATISTICS TIME
OFF;
其他参考:
https://www.cnblogs.com/xcsn/p/7773212.html
SQL 查看SQL语句的执行时间 直接有效的方法
标签:alt info group weight 配置 磁盘 访问 idt file