我的项目是 EF 5,使用 DbContext。
我刚刚注意到,我第一次在 LinqPad 中运行任何 Linq 查询时,都会有轻微的延迟,并且生成的 SQL 开头如下。随后的运行,没有延迟,也没有额外的 SQL。
谁能向我解释一下这个 SQL 是什么,我是否应该担心它?
SELECT TABLE_SCHEMA SchemaName, TABLE_NAME Name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'
GO
SELECT
[GroupBy1].[A1] AS [C1]
FROM ( SELECT
COUNT(1) AS [A1]
FROM [dbo].[__MigrationHistory] AS [Extent1]
) AS [GroupBy1]
GO
SELECT TOP (1)
[Extent1].[Id] AS [Id],
[Extent1].[ModelHash] AS [ModelHash]
FROM [dbo].[EdmMetadata] AS [Extent1]
ORDER BY [Extent1].[Id] DESC
GO