我的asp.net mvc中的action方法中有以下代码: -
var vm = repository.ITVMsCore()
.OrderBy(a => a.Technology.PartialTag)
.ToPagedList(page, pagesize);
将调用以下存储库方法: -
public IQueryable<ITVirtualMachine> ITVMsCore()
{
return IT.ITVirtualMachines
.Include(a2 => a2.Technology.TechnologyType)
.Include(a6 => a6.Technology.TechnologyIPs)
.Include(a10 => a10.ITServer.Technology)
.Include(a11 => a11.ITServer.ITRack.Technology);
当我调用action方法时,Sql探查器生成了以下长查询: -
exec sp_executesql N'SELECT
[Project2].[TechnologyID] AS [TechnologyID],
[Project2].[ITRackID] AS [ITRackID],
[Project2].[ITServerID] AS [ITServerID],
[Project2].[ITVirtualMachineID] AS [ITVirtualMachineID],
[Project2].[TechnologyID1] AS [TechnologyID1],
[Project2].[ITRackID1] AS [ITRackID1],
[Project2].[ITServerID1] AS [ITServerID1],
[Project2].[ITRackID2] AS [ITRackID2],
[Project2].[ITServerID2] AS [ITServerID2],
[Project2].[TechnologyID3] AS [TechnologyID2],
[Project2].[ITRackID3] AS [ITRackID3],
[Project2].[ITServerID3] AS [ITServerID3],
[Project2].[ITRackID4] AS [ITRackID4],
[Project2].[ITVirtualMachineID1] AS [ITVirtualMachineID1],
[Project2].[ITServerID5] AS [ITServerID4],
[Project2].[ServerID] AS [ServerID],
[Project2].[ITServerID4] AS [ITServerID5],
[Project2].[ITRackID5] AS [ITRackID5],
[Project2].[ITServerID6] AS [ITServerID6],
[Project2].[ITVirtualMachineID2] AS [ITVirtualMachineID2],
[Project2].[ITRackID6] AS [ITRackID6],
[Project2].[RoleID] AS [RoleID],
[Project2].[BackUpStatusID] AS [BackUpStatusID],
[Project2].[StatusID] AS [StatusID],
[Project2].[MonitoreID] AS [MonitoreID],
[Project2].[TotalStorage] AS [TotalStorage],
[Project2].[Comment] AS [Comment],
[Project2].[timestamp] AS [timestamp],
[Project2].[IT360SiteID] AS [IT360SiteID],
[Project2].[TechnologyID2] AS [TechnologyID3],
[Project2].[Tag] AS [Tag],
[Project2].[IsDeleted] AS [IsDeleted],
[Project2].[timestamp1] AS [timestamp1],
[Project2].[TypeID] AS [TypeID],
[Project2].[StartDate] AS [StartDate],
[Project2].[IT360ID] AS [IT360ID],
[Project2].[IsCompleted] AS [IsCompleted],
[Project2].[PartialTag1] AS [PartialTag],
[Project2].[AssetTypeID] AS [AssetTypeID],
[Project2].[Name] AS [Name],
[Project2].[IncludedInSearch] AS [IncludedInSearch],
[Project2].[ServerModelID] AS [ServerModelID],
[Project2].[ILOIP] AS [ILOIP],
[Project2].[RackID] AS [RackID],
[Project2].[StatusID1] AS [StatusID1],
[Project2].[BackUpStatusID1] AS [BackUpStatusID1],
[Project2].[RoleID1] AS [RoleID1],
[Project2].[OperatingSystemID] AS [OperatingSystemID],
[Project2].[VirtualCenterID] AS [VirtualCenterID],
[Project2].[Comment1] AS [Comment1],
[Project2].[timestamp2] AS [timestamp2],
[Project2].[IT360SiteID1] AS [IT360SiteID1],
[Project2].[TechnologyID4] AS [TechnologyID4],
[Project2].[Tag1] AS [Tag1],
[Project2].[IsDeleted1] AS [IsDeleted1],
[Project2].[timestamp3] AS [timestamp3],
[Project2].[TypeID1] AS [TypeID1],
[Project2].[StartDate1] AS [StartDate1],
[Project2].[IT360ID1] AS [IT360ID1],
[Project2].[IsCompleted1] AS [IsCompleted1],
[Project2].[PartialTag2] AS [PartialTag1],
[Project2].[DataCenterID] AS [DataCenterID],
[Project2].[ZoneID] AS [ZoneID],
[Project2].[timestamp4] AS [timestamp4],
[Project2].[IT360SiteID2] AS [IT360SiteID2],
[Project2].[TechnologyID5] AS [TechnologyID5],
[Project2].[Tag2] AS [Tag2],
[Project2].[IsDeleted2] AS [IsDeleted2],
[Project2].[timestamp5] AS [timestamp5],
[Project2].[TypeID2] AS [TypeID2],
[Project2].[StartDate2] AS [StartDate2],
[Project2].[IT360ID2] AS [IT360ID2],
[Project2].[IsCompleted2] AS [IsCompleted2],
[Project2].[PartialTag3] AS [PartialTag2],
[Project2].[C1] AS [C1],
[Project2].[TechnologyID6] AS [TechnologyID6],
[Project2].[IPAddress] AS [IPAddress],
[Project2].[ID] AS [ID],
[Project2].[MACAddress] AS [MACAddress],
[Project2].[IsPrimary] AS [IsPrimary]
FROM ( SELECT
[Limit1].[ITVirtualMachineID] AS [ITVirtualMachineID],
[Limit1].[ServerID] AS [ServerID],
[Limit1].[RoleID] AS [RoleID],
[Limit1].[BackUpStatusID] AS [BackUpStatusID],
[Limit1].[StatusID] AS [StatusID],
[Limit1].[MonitoreID] AS [MonitoreID],
[Limit1].[TotalStorage] AS [TotalStorage],
[Limit1].[Comment] AS [Comment],
[Limit1].[timestamp] AS [timestamp],
[Limit1].[IT360SiteID] AS [IT360SiteID],
[Limit1].[TechnologyID] AS [TechnologyID],
[Limit1].[ITRackID] AS [ITRackID],
[Limit1].[ITServerID] AS [ITServerID],
[Limit1].[TechnologyID1] AS [TechnologyID1],
[Limit1].[PartialTag] AS [PartialTag],
[Limit1].[ITRackID1] AS [ITRackID1],
[Limit1].[ITServerID1] AS [ITServerID1],
[Limit1].[TechnologyID2] AS [TechnologyID2],
[Limit1].[Tag] AS [Tag],
[Limit1].[IsDeleted] AS [IsDeleted],
[Limit1].[timestamp1] AS [timestamp1],
[Limit1].[TypeID] AS [TypeID],
[Limit1].[StartDate] AS [StartDate],
[Limit1].[IT360ID] AS [IT360ID],
[Limit1].[IsCompleted] AS [IsCompleted],
[Limit1].[PartialTag1] AS [PartialTag1],
[Limit1].[ITRackID2] AS [ITRackID2],
[Limit1].[ITServerID2] AS [ITServerID2],
[Limit1].[TechnologyID3] AS [TechnologyID3],
[Limit1].[ITRackID3] AS [ITRackID3],
[Limit1].[ITServerID3] AS [ITServerID3],
[Limit1].[AssetTypeID] AS [AssetTypeID],
[Limit1].[Name] AS [Name],
[Limit1].[IncludedInSearch] AS [IncludedInSearch],
[Limit1].[ITServerID4] AS [ITServerID4],
[Limit1].[ServerModelID] AS [ServerModelID],
[Limit1].[ILOIP] AS [ILOIP],
[Limit1].[RackID] AS [RackID],
[Limit1].[StatusID1] AS [StatusID1],
[Limit1].[BackUpStatusID1] AS [BackUpStatusID1],
[Limit1].[RoleID1] AS [RoleID1],
[Limit1].[OperatingSystemID] AS [OperatingSystemID],
[Limit1].[VirtualCenterID] AS [VirtualCenterID],
[Limit1].[Comment1] AS [Comment1],
[Limit1].[timestamp2] AS [timestamp2],
[Limit1].[IT360SiteID1] AS [IT360SiteID1],
[Limit1].[TechnologyID4] AS [TechnologyID4],
[Limit1].[Tag1] AS [Tag1],
[Limit1].[IsDeleted1] AS [IsDeleted1],
[Limit1].[timestamp3] AS [timestamp3],
[Limit1].[TypeID1] AS [TypeID1],
[Limit1].[StartDate1] AS [StartDate1],
[Limit1].[IT360ID1] AS [IT360ID1],
[Limit1].[IsCompleted1] AS [IsCompleted1],
[Limit1].[PartialTag2] AS [PartialTag2],
[Limit1].[ITRackID4] AS [ITRackID4],
[Limit1].[ITServerID5] AS [ITServerID5],
[Limit1].[ITVirtualMachineID1] AS [ITVirtualMachineID1],
[Limit1].[ITRackID5] AS [ITRackID5],
[Limit1].[DataCenterID] AS [DataCenterID],
[Limit1].[ZoneID] AS [ZoneID],
[Limit1].[timestamp4] AS [timestamp4],
[Limit1].[IT360SiteID2] AS [IT360SiteID2],
[Limit1].[TechnologyID5] AS [TechnologyID5],
[Limit1].[Tag2] AS [Tag2],
[Limit1].[IsDeleted2] AS [IsDeleted2],
[Limit1].[timestamp5] AS [timestamp5],
[Limit1].[TypeID2] AS [TypeID2],
[Limit1].[StartDate2] AS [StartDate2],
[Limit1].[IT360ID2] AS [IT360ID2],
[Limit1].[IsCompleted2] AS [IsCompleted2],
[Limit1].[PartialTag3] AS [PartialTag3],
[Limit1].[ITRackID6] AS [ITRackID6],
[Limit1].[ITServerID6] AS [ITServerID6],
[Limit1].[ITVirtualMachineID2] AS [ITVirtualMachineID2],
[Join24].[TechnologyID] AS [TechnologyID6],
[Join24].[IPAddress] AS [IPAddress],
[Join24].[ID] AS [ID],
[Join24].[MACAddress] AS [MACAddress],
[Join24].[IsPrimary] AS [IsPrimary],
CASE WHEN ([Join24].[ID] IS NULL) THEN CAST(NULL AS int) ELSE 1 END AS [C1]
FROM (SELECT TOP (15) [Project1].[ITVirtualMachineID] AS [ITVirtualMachineID], [Project1].[ServerID] AS [ServerID], [Project1].[RoleID] AS [RoleID], [Project1].[BackUpStatusID] AS [BackUpStatusID], [Project1].[StatusID] AS [StatusID], [Project1].[MonitoreID] AS [MonitoreID], [Project1].[TotalStorage] AS [TotalStorage], [Project1].[Comment] AS [Comment], [Project1].[timestamp] AS [timestamp], [Project1].[IT360SiteID] AS [IT360SiteID], [Project1].[TechnologyID] AS [TechnologyID], [Project1].[ITRackID] AS [ITRackID], [Project1].[ITServerID] AS [ITServerID], [Project1].[TechnologyID1] AS [TechnologyID1], [Project1].[PartialTag] AS [PartialTag], [Project1].[ITRackID1] AS [ITRackID1], [Project1].[ITServerID1] AS [ITServerID1], [Project1].[TechnologyID2] AS [TechnologyID2], [Project1].[Tag] AS [Tag], [Project1].[IsDeleted] AS [IsDeleted], [Project1].[timestamp1] AS [timestamp1], [Project1].[TypeID] AS [TypeID], [Project1].[StartDate] AS [StartDate], [Project1].[IT360ID] AS [IT360ID], [Project1].[IsCompleted] AS [IsCompleted], [Project1].[PartialTag1] AS [PartialTag1], [Project1].[ITRackID2] AS [ITRackID2], [Project1].[ITServerID2] AS [ITServerID2], [Project1].[TechnologyID3] AS [TechnologyID3], [Project1].[ITRackID3] AS [ITRackID3], [Project1].[ITServerID3] AS [ITServerID3], [Project1].[AssetTypeID] AS [AssetTypeID], [Project1].[Name] AS [Name], [Project1].[IncludedInSearch] AS [IncludedInSearch], [Project1].[ITServerID4] AS [ITServerID4], [Project1].[ServerModelID] AS [ServerModelID], [Project1].[ILOIP] AS [ILOIP], [Project1].[RackID] AS [RackID], [Project1].[StatusID1] AS [StatusID1], [Project1].[BackUpStatusID1] AS [BackUpStatusID1], [Project1].[RoleID1] AS [RoleID1], [Project1].[OperatingSystemID] AS [OperatingSystemID], [Project1].[VirtualCenterID] AS [VirtualCenterID], [Project1].[Comment1] AS [Comment1], [Project1].[timestamp2] AS [timestamp2], [Project1].[IT360SiteID1] AS [IT360SiteID1], [Project1].[TechnologyID4] AS [TechnologyID4], [Project1].[Tag1] AS [Tag1], [Project1].[IsDeleted1] AS [IsDeleted1], [Project1].[timestamp3] AS [timestamp3], [Project1].[TypeID1] AS [TypeID1], [Project1].[StartDate1] AS [StartDate1], [Project1].[IT360ID1] AS [IT360ID1], [Project1].[IsCompleted1] AS [IsCompleted1], [Project1].[PartialTag2] AS [PartialTag2], [Project1].[ITRackID4] AS [ITRackID4], [Project1].[ITServerID5] AS [ITServerID5], [Project1].[ITVirtualMachineID1] AS [ITVirtualMachineID1], [Project1].[ITRackID5] AS [ITRackID5], [Project1].[DataCenterID] AS [DataCenterID], [Project1].[ZoneID] AS [ZoneID], [Project1].[timestamp4] AS [timestamp4], [Project1].[IT360SiteID2] AS [IT360SiteID2], [Project1].[TechnologyID5] AS [TechnologyID5], [Project1].[Tag2] AS [Tag2], [Project1].[IsDeleted2] AS [IsDeleted2], [Project1].[timestamp5] AS [timestamp5], [Project1].[TypeID2] AS [TypeID2], [Project1].[StartDate2] AS [StartDate2], [Project1].[IT360ID2] AS [IT360ID2], [Project1].[IsCompleted2] AS [IsCompleted2], [Project1].[PartialTag3] AS [PartialTag3], [Project1].[ITRackID6] AS [ITRackID6], [Project1].[ITServerID6] AS [ITServerID6], [Project1].[ITVirtualMachineID2] AS [ITVirtualMachineID2]
FROM ( SELECT [Project1].[ITVirtualMachineID] AS [ITVirtualMachineID], [Project1].[ServerID] AS [ServerID], [Project1].[RoleID] AS [RoleID], [Project1].[BackUpStatusID] AS [BackUpStatusID], [Project1].[StatusID] AS [StatusID], [Project1].[MonitoreID] AS [MonitoreID], [Project1].[TotalStorage] AS [TotalStorage], [Project1].[Comment] AS [Comment], [Project1].[timestamp] AS [timestamp], [Project1].[IT360SiteID] AS [IT360SiteID], [Project1].[TechnologyID] AS [TechnologyID], [Project1].[ITRackID] AS [ITRackID], [Project1].[ITServerID] AS [ITServerID], [Project1].[TechnologyID1] AS [TechnologyID1], [Project1].[PartialTag] AS [PartialTag], [Project1].[ITRackID1] AS [ITRackID1], [Project1].[ITServerID1] AS [ITServerID1], [Project1].[TechnologyID2] AS [TechnologyID2], [Project1].[Tag] AS [Tag], [Project1].[IsDeleted] AS [IsDeleted], [Project1].[timestamp1] AS [timestamp1], [Project1].[TypeID] AS [TypeID], [Project1].[StartDate] AS [StartDate], [Project1].[IT360ID] AS [IT360ID], [Project1].[IsCompleted] AS [IsCompleted], [Project1].[PartialTag1] AS [PartialTag1], [Project1].[ITRackID2] AS [ITRackID2], [Project1].[ITServerID2] AS [ITServerID2], [Project1].[TechnologyID3] AS [TechnologyID3], [Project1].[ITRackID3] AS [ITRackID3], [Project1].[ITServerID3] AS [ITServerID3], [Project1].[AssetTypeID] AS [AssetTypeID], [Project1].[Name] AS [Name], [Project1].[IncludedInSearch] AS [IncludedInSearch], [Project1].[ITServerID4] AS [ITServerID4], [Project1].[ServerModelID] AS [ServerModelID], [Project1].[ILOIP] AS [ILOIP], [Project1].[RackID] AS [RackID], [Project1].[StatusID1] AS [StatusID1], [Project1].[BackUpStatusID1] AS [BackUpStatusID1], [Project1].[RoleID1] AS [RoleID1], [Project1].[OperatingSystemID] AS [OperatingSystemID], [Project1].[VirtualCenterID] AS [VirtualCenterID], [Project1].[Comment1] AS [Comment1], [Project1].[timestamp2] AS [timestamp2], [Project1].[IT360SiteID1] AS [IT360SiteID1], [Project1].[TechnologyID4] AS [TechnologyID4], [Project1].[Tag1] AS [Tag1], [Project1].[IsDeleted1] AS [IsDeleted1], [Project1].[timestamp3] AS [timestamp3], [Project1].[TypeID1] AS [TypeID1], [Project1].[StartDate1] AS [StartDate1], [Project1].[IT360ID1] AS [IT360ID1], [Project1].[IsCompleted1] AS [IsCompleted1], [Project1].[PartialTag2] AS [PartialTag2], [Project1].[ITRackID4] AS [ITRackID4], [Project1].[ITServerID5] AS [ITServerID5], [Project1].[ITVirtualMachineID1] AS [ITVirtualMachineID1], [Project1].[ITRackID5] AS [ITRackID5], [Project1].[DataCenterID] AS [DataCenterID], [Project1].[ZoneID] AS [ZoneID], [Project1].[timestamp4] AS [timestamp4], [Project1].[IT360SiteID2] AS [IT360SiteID2], [Project1].[TechnologyID5] AS [TechnologyID5], [Project1].[Tag2] AS [Tag2], [Project1].[IsDeleted2] AS [IsDeleted2], [Project1].[timestamp5] AS [timestamp5], [Project1].[TypeID2] AS [TypeID2], [Project1].[StartDate2] AS [StartDate2], [Project1].[IT360ID2] AS [IT360ID2], [Project1].[IsCompleted2] AS [IsCompleted2], [Project1].[PartialTag3] AS [PartialTag3], [Project1].[ITRackID6] AS [ITRackID6], [Project1].[ITServerID6] AS [ITServerID6], [Project1].[ITVirtualMachineID2] AS [ITVirtualMachineID2], row_number() OVER (ORDER BY [Project1].[PartialTag] ASC) AS [row_number]
FROM ( SELECT
[Extent1].[ITVirtualMachineID] AS [ITVirtualMachineID],
[Extent1].[ServerID] AS [ServerID],
[Extent1].[RoleID] AS [RoleID],
[Extent1].[BackUpStatusID] AS [BackUpStatusID],
[Extent1].[StatusID] AS [StatusID],
[Extent1].[MonitoreID] AS [MonitoreID],
[Extent1].[TotalStorage] AS [TotalStorage],
[Extent1].[Comment] AS [Comment],
[Extent1].[timestamp] AS [timestamp],
[Extent1].[IT360SiteID] AS [IT360SiteID],
[Join2].[TechnologyID] AS [TechnologyID],
[Join2].[ITRackID] AS [ITRackID],
[Join2].[ITServerID] AS [ITServerID],
[Join5].[TechnologyID] AS [TechnologyID1],
[Join5].[PartialTag] AS [PartialTag],
[Join5].[ITRackID] AS [ITRackID1],
[Join5].[ITServerID] AS [ITServerID1],
[Join8].[TechnologyID] AS [TechnologyID2],
[Join8].[Tag] AS [Tag],
[Join8].[IsDeleted] AS [IsDeleted],
[Join8].[timestamp6] AS [timestamp1],
[Join8].[TypeID] AS [TypeID],
[Join8].[StartDate] AS [StartDate],
[Join8].[IT360ID] AS [IT360ID],
[Join8].[IsCompleted] AS [IsCompleted],
[Join8].[PartialTag] AS [PartialTag1],
[Join8].[ITRackID] AS [ITRackID2],
[Join8].[ITServerID] AS [ITServerID2],
[Join11].[TechnologyID] AS [TechnologyID3],
[Join11].[ITRackID] AS [ITRackID3],
[Join11].[ITServerID] AS [ITServerID3],
[Extent14].[AssetTypeID] AS [AssetTypeID],
[Extent14].[Name] AS [Name],
[Extent14].[IncludedInSearch] AS [IncludedInSearch],
[Extent15].[ITServerID] AS [ITServerID4],
[Extent15].[ServerModelID] AS [ServerModelID],
[Extent15].[ILOIP] AS [ILOIP],
[Extent15].[RackID] AS [RackID],
[Extent15].[StatusID] AS [StatusID1],
[Extent15].[BackUpStatusID] AS [BackUpStatusID1],
[Extent15].[RoleID] AS [RoleID1],
[Extent15].[OperatingSystemID] AS [OperatingSystemID],
[Extent15].[VirtualCenterID] AS [VirtualCenterID],
[Extent15].[Comment] AS [Comment1],
[Extent15].[timestamp] AS [timestamp2],
[Extent15].[IT360SiteID] AS [IT360SiteID1],
[Join17].[TechnologyID] AS [TechnologyID4],
[Join17].[Tag] AS [Tag1],
[Join17].[IsDeleted] AS [IsDeleted1],
[Join17].[timestamp7] AS [timestamp3],
[Join17].[TypeID] AS [TypeID1],
[Join17].[StartDate] AS [StartDate1],
[Join17].[IT360ID] AS [IT360ID1],
[Join17].[IsCompleted] AS [IsCompleted1],
[Join17].[PartialTag] AS [PartialTag2],
[Join17].[ITRackID] AS [ITRackID4],
[Join17].[ITServerID] AS [ITServerID5],
[Join17].[ITVirtualMachineID] AS [ITVirtualMachineID1],
[Extent20].[ITRackID] AS [ITRackID5],
[Extent20].[DataCenterID] AS [DataCenterID],
[Extent20].[ZoneID] AS [ZoneID],
[Extent20].[timestamp] AS [timestamp4],
[Extent20].[IT360SiteID] AS [IT360SiteID2],
[Join22].[TechnologyID] AS [TechnologyID5],
[Join22].[Tag] AS [Tag2],
[Join22].[IsDeleted] AS [IsDeleted2],
[Join22].[timestamp8] AS [timestamp5],
[Join22].[TypeID] AS [TypeID2],
[Join22].[StartDate] AS [StartDate2],
[Join22].[IT360ID] AS [IT360ID2],
[Join22].[IsCompleted] AS [IsCompleted2],
[Join22].[PartialTag] AS [PartialTag3],
[Join22].[ITRackID] AS [ITRackID6],
[Join22].[ITServerID] AS [ITServerID6],
[Join22].[ITVirtualMachineID] AS [ITVirtualMachineID2]
FROM [dbo].[ITVirtualMachines] AS [Extent1]
INNER JOIN (SELECT [Extent2].[TechnologyID] AS [TechnologyID], [Extent2].[Tag] AS [Tag], [Extent3].[ITRackID] AS [ITRackID], [Extent4].[ITServerID] AS [ITServerID]
FROM [dbo].[Technology] AS [Extent2]
LEFT OUTER JOIN [dbo].[ITRacks] AS [Extent3] ON [Extent2].[TechnologyID] = [Extent3].[ITRackID]
LEFT OUTER JOIN [dbo].[ITServers] AS [Extent4] ON [Extent2].[TechnologyID] = [Extent4].[ITServerID] ) AS [Join2] ON [Extent1].[ITVirtualMachineID] = [Join2].[TechnologyID]
INNER JOIN (SELECT [Extent5].[TechnologyID] AS [TechnologyID], [Extent5].[PartialTag] AS [PartialTag], [Extent6].[ITRackID] AS [ITRackID], [Extent7].[ITServerID] AS [ITServerID]
FROM [dbo].[Technology] AS [Extent5]
LEFT OUTER JOIN [dbo].[ITRacks] AS [Extent6] ON [Extent5].[TechnologyID] = [Extent6].[ITRackID]
LEFT OUTER JOIN [dbo].[ITServers] AS [Extent7] ON [Extent5].[TechnologyID] = [Extent7].[ITServerID] ) AS [Join5] ON [Extent1].[ITVirtualMachineID] = [Join5].[TechnologyID]
INNER JOIN (SELECT [Extent8].[TechnologyID] AS [TechnologyID], [Extent8].[Tag] AS [Tag], [Extent8].[IsDeleted] AS [IsDeleted], [Extent8].[timestamp] AS [timestamp6], [Extent8].[TypeID] AS [TypeID], [Extent8].[StartDate] AS [StartDate], [Extent8].[IT360ID] AS [IT360ID], [Extent8].[IsCompleted] AS [IsCompleted], [Extent8].[PartialTag] AS [PartialTag], [Extent9].[ITRackID] AS [ITRackID], [Extent10].[ITServerID] AS [ITServerID]
FROM [dbo].[Technology] AS [Extent8]
LEFT OUTER JOIN [dbo].[ITRacks] AS [Extent9] ON [Extent8].[TechnologyID] = [Extent9].[ITRackID]
LEFT OUTER JOIN [dbo].[ITServers] AS [Extent10] ON [Extent8].[TechnologyID] = [Extent10].[ITServerID] ) AS [Join8] ON [Extent1].[ITVirtualMachineID] = [Join8].[TechnologyID]
INNER JOIN (SELECT [Extent11].[TechnologyID] AS [TechnologyID], [Extent11].[TypeID] AS [TypeID], [Extent12].[ITRackID] AS [ITRackID], [Extent13].[ITServerID] AS [ITServerID]
FROM [dbo].[Technology] AS [Extent11]
LEFT OUTER JOIN [dbo].[ITRacks] AS [Extent12] ON [Extent11].[TechnologyID] = [Extent12].[ITRackID]
LEFT OUTER JOIN [dbo].[ITServers] AS [Extent13] ON [Extent11].[TechnologyID] = [Extent13].[ITServerID] ) AS [Join11] ON [Extent1].[ITVirtualMachineID] = [Join11].[TechnologyID]
LEFT OUTER JOIN [dbo].[TechnologyTypes] AS [Extent14] ON [Join11].[TypeID] = [Extent14].[AssetTypeID]
INNER JOIN [dbo].[ITServers] AS [Extent15] ON [Extent1].[ServerID] = [Extent15].[ITServerID]
LEFT OUTER JOIN (SELECT [Extent16].[TechnologyID] AS [TechnologyID], [Extent16].[Tag] AS [Tag], [Extent16].[IsDeleted] AS [IsDeleted], [Extent16].[timestamp] AS [timestamp7], [Extent16].[TypeID] AS [TypeID], [Extent16].[StartDate] AS [StartDate], [Extent16].[IT360ID] AS [IT360ID], [Extent16].[IsCompleted] AS [IsCompleted], [Extent16].[PartialTag] AS [PartialTag], [Extent17].[ITRackID] AS [ITRackID], [Extent18].[ITServerID] AS [ITServerID], [Extent19].[ITVirtualMachineID] AS [ITVirtualMachineID]
FROM [dbo].[Technology] AS [Extent16]
LEFT OUTER JOIN [dbo].[ITRacks] AS [Extent17] ON [Extent16].[TechnologyID] = [Extent17].[ITRackID]
LEFT OUTER JOIN [dbo].[ITServers] AS [Extent18] ON [Extent16].[TechnologyID] = [Extent18].[ITServerID]
LEFT OUTER JOIN [dbo].[ITVirtualMachines] AS [Extent19] ON [Extent16].[TechnologyID] = [Extent19].[ITVirtualMachineID] ) AS [Join17] ON [Extent1].[ServerID] = [Join17].[ITServerID]
INNER JOIN [dbo].[ITRacks] AS [Extent20] ON [Extent15].[RackID] = [Extent20].[ITRackID]
LEFT OUTER JOIN (SELECT [Extent21].[TechnologyID] AS [TechnologyID], [Extent21].[Tag] AS [Tag], [Extent21].[IsDeleted] AS [IsDeleted], [Extent21].[timestamp] AS [timestamp8], [Extent21].[TypeID] AS [TypeID], [Extent21].[StartDate] AS [StartDate], [Extent21].[IT360ID] AS [IT360ID], [Extent21].[IsCompleted] AS [IsCompleted], [Extent21].[PartialTag] AS [PartialTag], [Extent22].[ITRackID] AS [ITRackID], [Extent23].[ITServerID] AS [ITServerID], [Extent24].[ITVirtualMachineID] AS [ITVirtualMachineID]
FROM [dbo].[Technology] AS [Extent21]
LEFT OUTER JOIN [dbo].[ITRacks] AS [Extent22] ON [Extent21].[TechnologyID] = [Extent22].[ITRackID]
LEFT OUTER JOIN [dbo].[ITServers] AS [Extent23] ON [Extent21].[TechnologyID] = [Extent23].[ITServerID]
LEFT OUTER JOIN [dbo].[ITVirtualMachines] AS [Extent24] ON [Extent21].[TechnologyID] = [Extent24].[ITVirtualMachineID] ) AS [Join22] ON [Extent20].[ITRackID] = [Join22].[ITRackID]
WHERE (@p__linq__0 IS NULL) OR (( CAST(LEN(@p__linq__0) AS int)) = 0) OR (( CAST(CHARINDEX(UPPER(@p__linq__1), UPPER([Join2].[Tag])) AS int)) = 1)
) AS [Project1]
) AS [Project1]
WHERE [Project1].[row_number] > 0
ORDER BY [Project1].[PartialTag] ASC ) AS [Limit1]
LEFT OUTER JOIN (SELECT [Extent25].[TechnologyID] AS [TechnologyID], [Extent25].[IPAddress] AS [IPAddress], [Extent25].[ID] AS [ID], [Extent25].[MACAddress] AS [MACAddress], [Extent25].[IsPrimary] AS [IsPrimary], [Extent26].[ITVirtualMachineID] AS [ITVirtualMachineID]
FROM [dbo].[TechnologyIP] AS [Extent25]
INNER JOIN [dbo].[ITVirtualMachines] AS [Extent26] ON [Extent25].[TechnologyID] = [Extent26].[ITVirtualMachineID] ) AS [Join24] ON [Limit1].[ITVirtualMachineID] = [Join24].[ITVirtualMachineID]
) AS [Project2]
ORDER BY [Project2].[PartialTag] ASC, [Project2].[TechnologyID] ASC, [Project2].[ITRackID] ASC, [Project2].[ITServerID] ASC, [Project2].[ITVirtualMachineID] ASC, [Project2].[TechnologyID1] ASC, [Project2].[ITRackID1] ASC, [Project2].[ITServerID1] ASC, [Project2].[ITRackID2] ASC, [Project2].[ITServerID2] ASC, [Project2].[TechnologyID3] ASC, [Project2].[ITRackID3] ASC, [Project2].[ITServerID3] ASC, [Project2].[ITRackID4] ASC, [Project2].[ITVirtualMachineID1] ASC, [Project2].[ITServerID5] ASC, [Project2].[ServerID] ASC, [Project2].[ITServerID4] ASC, [Project2].[ITRackID5] ASC, [Project2].[ITServerID6] ASC, [Project2].[ITVirtualMachineID2] ASC, [Project2].[ITRackID6] ASC, [Project2].[TechnologyID2] ASC, [Project2].[AssetTypeID] ASC, [Project2].[TechnologyID4] ASC, [Project2].[TechnologyID5] ASC, [Project2].[C1] ASC',N'@p__linq__0 nvarchar(4000),@p__linq__1 nvarchar(4000)',@p__linq__0=N'',@p__linq__1=N''
但我注意到在Sql profiler查询中有很多OrderBy调用,所以不确定这是否只是实体框架语法,或者我的操作方法orderby中将在DB内部生成多个OrderBy,< / p>
OrderBy(a => a.Technology.PartialTag)
可能会影响性能?可以提出任何建议吗?