Hi,
Our XAF Audit Trail has hit 1 million records and performance is very bad. See attached ExpensiveSQL.png.
Below is the SQL Statement from 2008 R2 SQL Management Studio Execution Plan:
(@p0 int,@p1 nvarchar(4000))select top 1 N0."Oid",N1."TargetType",N1."TargetKey",N1."OptimisticLockField",N1."GCRecord",N1."ObjectType",N0."GuidId",N0."IntId",N0."DisplayName" from ("dbo"."AuditedObjectWeakReference" N0
inner join "dbo"."XPWeakReference" N1 on (N0."Oid" = N1."Oid"))
where (N1."GCRecord" is null and (N1."TargetType" = @p0) and (N1."TargetKey" = @p1))
After adding a recommended index as shown below the problem is resolved:
**CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[XPWeakReference] ([TargetType],[TargetKey],[GCRecord]) **
Is this a missing index from XAF Audit Trail ?
If so, will you implement in future version as I m afraid similar index being created after upgrading XAF.
If not, do I need to add manually for other types of DBMS like Oracle ?
With Regards
Edward Tan