julianhyde/optiq — pull request #304 by vlsi (2014-06-22 19:59:21+00:00)
Title: Reduce count(not null) to count()

When `AVG(x)` and similar aggregates are transformed to `SUM(x)/COUNT(x)`, the `COUNT(x)` tend to duplicate.

I suggest check for non-distinct `COUNT` with at least one not-null argument and use plain `COUNT()`.