-
Type: Improvement
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 5.6.0-HF22, 5.7.2
-
Fix Version/s: QualifiedToSchedule
-
Component/s: Core VCS
-
Tags:
According to one of our customer's DBA the usage of cursor have a memory footprint impact and should be avoid at least for the nx_get_local_read_acl sproc that is called a lot of time during the update of the read acls.
Here a possible impl to test and merge
CREATE FUNCTION nx_get_local_read_acl_2(@id VARCHAR(36)) RETURNS NVARCHAR(4000) AS BEGIN DECLARE @Read_ACL NVARCHAR(MAX)='' SELECT @Read_ACL +=(CASE WHEN ([grant] = 0) THEN N'-' ELSE N'' END) + [user] + N',' FROM acls INNER JOIN dbo.aclr_permission ap ON a.permission = ap.permission WHERE [id] = @Id ORDER BY [pos] IF @Read_ACL IS NOT NULL SET @Read_ACL =LEFT(@Read_ACL,LEN(@Read_ACL)-1) RETURN @Read_ACL END