我们在使用2sxc表单在DNN网站上提交表单时,看到一些相当极端(我称之为极端)的速度约为20秒。
问题似乎是在每个表单提交时,2sxc在后台执行大约20个左右的SQL语句,其中一个每次运行需要8到13秒。剩下的时间不到100毫秒。查询可以在下面看到。
我尝试重新编制数据库索引,没有帮助。我想知道为什么这个查询正在运行,也许我可以将其关闭或做任何事情以提高性能。
SELECT
[UnionAll1].[EntityID] AS [C1],
[UnionAll1].[AttributeSetID] AS [C2],
[UnionAll1].[AttributeSetID1] AS [C3],
[UnionAll1].[ChangeID] AS [C4],
[UnionAll1].[C2] AS [C5],
[UnionAll1].[EntityID1] AS [C6],
[UnionAll1].[EntityGUID] AS [C7],
[UnionAll1].[AttributeSetID2] AS [C8],
[UnionAll1].[C3] AS [C9],
[UnionAll1].[AssignmentObjectTypeID] AS [C10],
[UnionAll1].[KeyGuid] AS [C11],
[UnionAll1].[KeyNumber] AS [C12],
[UnionAll1].[KeyString] AS [C13],
[UnionAll1].[IsPublished] AS [C14],
[UnionAll1].[PublishedEntityId] AS [C15],
[UnionAll1].[Owner] AS [C16],
[UnionAll1].[Timestamp] AS [C17],
[UnionAll1].[C1] AS [C18],
[UnionAll1].[AttributeID] AS [C19],
[UnionAll1].[AttributeID1] AS [C20],
[UnionAll1].[C4] AS [C21],
[UnionAll1].[ChildEntityID] AS [C22],
[UnionAll1].[C5] AS [C23],
[UnionAll1].[C6] AS [C24],
[UnionAll1].[C7] AS [C25],
[UnionAll1].[C9] AS [C26],
[UnionAll1].[C10] AS [C27],
[UnionAll1].[C11] AS [C28],
[UnionAll1].[C12] AS [C29],
[UnionAll1].[C13] AS [C30],
[UnionAll1].[C14] AS [C31],
[UnionAll1].[C15] AS [C32],
[UnionAll1].[C16] AS [C33],
[UnionAll1].[C17] AS [C34]
FROM (SELECT
CASE WHEN ([Join3].[AttributeID1] IS NULL) THEN CAST(NULL AS int) ELSE 1 END AS [C1],
[Project1].[EntityID] AS [EntityID],
[Project1].[AttributeSetID1] AS [AttributeSetID],
[Project1].[AttributeSetID1] AS [AttributeSetID1],
[Project1].[ChangeID] AS [ChangeID],
[Project1].[C1] AS [C2],
[Project1].[EntityID] AS [EntityID1],
[Project1].[EntityGUID] AS [EntityGUID],
[Project1].[AttributeSetID] AS [AttributeSetID2],
[Project1].[C1] AS [C3],
[Project1].[AssignmentObjectTypeID] AS [AssignmentObjectTypeID],
[Project1].[KeyGuid] AS [KeyGuid],
[Project1].[KeyNumber] AS [KeyNumber],
[Project1].[KeyString] AS [KeyString],
[Project1].[IsPublished] AS [IsPublished],
[Project1].[PublishedEntityId] AS [PublishedEntityId],
[Project1].[Owner] AS [Owner],
[Project1].[Timestamp] AS [Timestamp],
[Join3].[AttributeID1] AS [AttributeID],
[Join3].[AttributeID1] AS [AttributeID1],
CASE WHEN ([Join3].[AttributeID1] IS NULL) THEN CAST(NULL AS int) WHEN ([Join3].[AttributeID2] IS NULL) THEN CAST(NULL AS int) ELSE 1 END AS [C4],
[Join3].[ChildEntityID] AS [ChildEntityID],
[Join3].[SortOrder] AS [SortOrder],
CAST(NULL AS int) AS [C5],
CAST(NULL AS int) AS [C6],
CAST(NULL AS int) AS [C7],
CAST(NULL AS int) AS [C8],
CAST(NULL AS int) AS [C9],
CAST(NULL AS int) AS [C10],
CAST(NULL AS varchar(1)) AS [C11],
CAST(NULL AS int) AS [C12],
CAST(NULL AS int) AS [C13],
CAST(NULL AS int) AS [C14],
CAST(NULL AS int) AS [C15],
CAST(NULL AS bit) AS [C16],
CAST(NULL AS varchar(1)) AS [C17]
FROM (SELECT
[Filter1].[EntityID] AS [EntityID],
[Filter1].[EntityGUID] AS [EntityGUID],
[Filter1].[AttributeSetID1] AS [AttributeSetID],
[Filter1].[AssignmentObjectTypeID] AS [AssignmentObjectTypeID],
[Filter1].[KeyNumber] AS [KeyNumber],
[Filter1].[KeyGuid] AS [KeyGuid],
[Filter1].[KeyString] AS [KeyString],
[Filter1].[IsPublished] AS [IsPublished],
[Filter1].[PublishedEntityId] AS [PublishedEntityId],
[Filter1].[Owner] AS [Owner],
[Filter1].[AttributeSetID2] AS [AttributeSetID1],
[Extent3].[ChangeID] AS [ChangeID],
[Extent3].[Timestamp] AS [Timestamp],
1 AS [C1]
FROM (SELECT [Extent1].[EntityID] AS [EntityID], [Extent1].[EntityGUID] AS [EntityGUID], [Extent1].[AttributeSetID] AS [AttributeSetID1], [Extent1].[AssignmentObjectTypeID] AS [AssignmentObjectTypeID], [Extent1].[KeyNumber] AS [KeyNumber], [Extent1].[KeyGuid] AS [KeyGuid], [Extent1].[KeyString] AS [KeyString], [Extent1].[IsPublished] AS [IsPublished], [Extent1].[PublishedEntityId] AS [PublishedEntityId], [Extent1].[ChangeLogModified] AS [ChangeLogModified], [Extent1].[Owner] AS [Owner], [Extent2].[AttributeSetID] AS [AttributeSetID2], [Extent2].[AppID] AS [AppID]
FROM [dbo].[ToSIC_EAV_Entities] AS [Extent1]
INNER JOIN [dbo].[ToSIC_EAV_AttributeSets] AS [Extent2] ON [Extent1].[AttributeSetID] = [Extent2].[AttributeSetID]
WHERE ([Extent1].[ChangeLogDeleted] IS NULL) AND ([Extent2].[ChangeLogDeleted] IS NULL) ) AS [Filter1]
LEFT OUTER JOIN [dbo].[ToSIC_EAV_ChangeLog] AS [Extent3] ON [Filter1].[ChangeLogModified] = [Extent3].[ChangeID]
WHERE ([Filter1].[AppID] = @p__linq__0) AND (@p__linq__1 <> cast(1 as bit)) ) AS [Project1]
OUTER APPLY (SELECT [Distinct1].[AttributeID] AS [AttributeID1], [Extent5].[AttributeID] AS [AttributeID2], [Extent5].[ChildEntityID] AS [ChildEntityID], [Extent5].[SortOrder] AS [SortOrder]
FROM (SELECT DISTINCT
[Extent4].[AttributeID] AS [AttributeID]
FROM [dbo].[ToSIC_EAV_EntityRelationships] AS [Extent4]
WHERE [Project1].[EntityID] = [Extent4].[ParentEntityID] ) AS [Distinct1]
LEFT OUTER JOIN [dbo].[ToSIC_EAV_EntityRelationships] AS [Extent5] ON ([Project1].[EntityID] = [Extent5].[ParentEntityID]) AND ([Distinct1].[AttributeID] = [Extent5].[AttributeID]) ) AS [Join3]
UNION ALL
SELECT
2 AS [C1],
[Project4].[EntityID] AS [EntityID],
[Project4].[AttributeSetID1] AS [AttributeSetID],
[Project4].[AttributeSetID1] AS [AttributeSetID1],
[Project4].[ChangeID] AS [ChangeID],
[Project4].[C1] AS [C2],
[Project4].[EntityID] AS [EntityID1],
[Project4].[EntityGUID] AS [EntityGUID],
[Project4].[AttributeSetID] AS [AttributeSetID2],
[Project4].[C1] AS [C3],
[Project4].[AssignmentObjectTypeID] AS [AssignmentObjectTypeID],
[Project4].[KeyGuid] AS [KeyGuid],
[Project4].[KeyNumber] AS [KeyNumber],
[Project4].[KeyString] AS [KeyString],
[Project4].[IsPublished] AS [IsPublished],
[Project4].[PublishedEntityId] AS [PublishedEntityId],
[Project4].[Owner] AS [Owner],
[Project4].[Timestamp] AS [Timestamp],
CAST(NULL AS int) AS [C4],
CAST(NULL AS int) AS [C5],
CAST(NULL AS int) AS [C6],
CAST(NULL AS int) AS [C7],
CAST(NULL AS int) AS [C8],
[Join8].[AttributeID3] AS [AttributeID],
[Join8].[AttributeID3] AS [AttributeID1],
CASE WHEN ([Join8].[ValueID1] IS NULL) THEN CAST(NULL AS int) ELSE 1 END AS [C9],
[Join8].[ChangeLogCreated] AS [ChangeLogCreated],
[Join8].[ValueID1] AS [ValueID],
[Join8].[ValueID1] AS [ValueID1],
[Join8].[Value] AS [Value],
[Join8].[ChangeLogCreated] AS [ChangeLogCreated1],
CASE WHEN ([Join8].[ValueID1] IS NULL) THEN CAST(NULL AS int) WHEN ([Join8].[ValueID2] IS NULL) THEN CAST(NULL AS int) ELSE 1 END AS [C10],
[Join8].[DimensionID1] AS [DimensionID],
[Join8].[DimensionID1] AS [DimensionID1],
[Join8].[ReadOnly] AS [ReadOnly],
CASE WHEN ([Join8].[ValueID1] IS NULL) THEN CAST(NULL AS varchar(1)) WHEN ([Join8].[ValueID2] IS NULL) THEN CAST(NULL AS varchar(1)) ELSE LOWER([Join8].[ExternalKey]) END AS [C11]
FROM (SELECT
[Filter4].[EntityID] AS [EntityID],
[Filter4].[EntityGUID] AS [EntityGUID],
[Filter4].[AttributeSetID3] AS [AttributeSetID],
[Filter4].[AssignmentObjectTypeID] AS [AssignmentObjectTypeID],
[Filter4].[KeyNumber] AS [KeyNumber],
[Filter4].[KeyGuid] AS [KeyGuid],
[Filter4].[KeyString] AS [KeyString],
[Filter4].[IsPublished] AS [IsPublished],
[Filter4].[PublishedEntityId] AS [PublishedEntityId],
[Filter4].[Owner] AS [Owner],
[Filter4].[AttributeSetID4] AS [AttributeSetID1],
[Extent8].[ChangeID] AS [ChangeID],
[Extent8].[Timestamp] AS [Timestamp],
1 AS [C1]
FROM (SELECT [Extent6].[EntityID] AS [EntityID], [Extent6].[EntityGUID] AS [EntityGUID], [Extent6].[AttributeSetID] AS [AttributeSetID3], [Extent6].[AssignmentObjectTypeID] AS [AssignmentObjectTypeID], [Extent6].[KeyNumber] AS [KeyNumber], [Extent6].[KeyGuid] AS [KeyGuid], [Extent6].[KeyString] AS [KeyString], [Extent6].[IsPublished] AS [IsPublished], [Extent6].[PublishedEntityId] AS [PublishedEntityId], [Extent6].[ChangeLogModified] AS [ChangeLogModified], [Extent6].[Owner] AS [Owner], [Extent7].[AttributeSetID] AS [AttributeSetID4], [Extent7].[AppID] AS [AppID]
FROM [dbo].[ToSIC_EAV_Entities] AS [Extent6]
INNER JOIN [dbo].[ToSIC_EAV_AttributeSets] AS [Extent7] ON [Extent6].[AttributeSetID] = [Extent7].[AttributeSetID
答案 0 :(得分:1)
你可以做一些事情,但具体来说2sxc 9.30在保存方面要快得多,因为它只进行部分缓存更新。
否则,在数据库上重建索引通常也会有很大帮助。