Hi, As you might know, SUM aggregate returns null when aggregating the empty set. Optiq replaces SUM(x) with "case when COUNT(x)>0 then SUM0(x) else NULL end" where SUM0 is guaranteed to have non-nullable type (returns 0 in case of empty set).
I wonder why is that made and if we can drop that SUM0. -- Regards, Vladimir Sitnikov
