Yes, Dieter, that's what I need to test now - to see if the rewrite did change the resultsets. I do found out that there are joins to NUPI columns and count of distinct is around 30% less than the count of the records. So I tend to do a subquery to distinct this column first and use this for joining, hope this could help lower the processing. I tried to maintain the join columns as the original query except for this one, but then again, i'm crossing my fingers right now.
Yes, Dieter, that's what I need to test now - to see if the rewrite did change the resultsets. I do found out that there are joins to NUPI columns and count of distinct is around 30% less than the count of the records. So I tend to do a subquery to distinct this column first and use this for joining, hope this could help lower the processing. I tried to maintain the join columns as the original query except for this one, but then again, i'm crossing my fingers right now.