• Apologies for the poor question structure. Its obviously my first time posting. Please find attached the table, indexes definitions and the estimated query plan.

    T1.TEMPLATE_FLG != 'Y' AND T1.TEMPLATE_FLG != 'P' OR T1.TEMPLATE_FLG IS NULL

    has been changed to

    (T1.TEMPLATE_FLG = 'N')

    The distinct values for T1.TEMPLATE_FLG is only P, Y or N so I thought i could simplify this by only putting N for the where clause.