Slow running query – help needed
Many thanks for your help, much appreciated!
The data types are as follows:-
• CRF1.Sys_Product is NvarChar (10)
• CAT1.Record_key was NvarChar(250) now changed to NvarChar(10)
I found some CRF1.Sys_Product records with ‘blank' values and I have now updated these with the appropriate CRF1.Sys_Product values.
I have added the missing index and it runs slightly quicker.
Is there any more that can be done?
The new plan still has a warning: PlanAffectingConvert ConvertIssue="Cardinality Estimate" Expression="CONVERT_IMPLICIT(int,[CRF1].[Sys_Product],0)" so this would be worth looking at to begin with.
I'm wondering if the index seek on [Insight_DBU_11202].[dbo].[FACT_SYS_RE_CRF_GL].[IDX_KAMTUNE01].(NonClustered) could be tweaked to assist the subsequent sort operation, I'm wondering if adding the Surrogate_Customer_PK as a key value instead of a non-key value (include) would assist or remove the sort?
See how that goes for now 🙂