Trying to understand why these two queries which are logically the same do not use the same indexes.
QUERY #1 SELECT TOP 400 * FROM AuditLog WITH ( NOLOCK ) WHERE CustomerID = 2379 AND PracticeID = 55 AND ( ( AuditTypeID = 4 AND EntityTypeID = 1022638 ) OR ( AuditTypeID = 6 AND SubEntityTypeID = 1022638 ) ) ORDER BY CreatedDate DESC QUERY #2 SELECT TOP 400 * FROM ( SELECT TOP 400 * FROM AuditLog WITH ( NOLOCK ) WHERE CustomerID = 2379 AND PracticeID = 55 AND ( AuditTypeID = 4 AND EntityTypeID = 1022638 ) ORDER BY CreatedDate UNION ALL SELECT TOP 400 * FROM AuditLog WITH ( NOLOCK ) WHERE CustomerID = 2379 AND PracticeID = 55 AND ( AuditTypeID = 6 AND SubEntityTypeID = 1022638 ) ORDER BY CreatedDate)sub ORDER BY sub.CreatedDate