TEIID-3063 TEIID-3062 enhancing logic dealing with constants and
distinct optimizations