Re: How to check for SELECT DISTINCT ...?

2016-05-14 Thread Julian Hyde
The “keys” are fields in the operators: * Aggregate.groupSet is a bit map, where "group by x, y” would be encoded by setting bits 2 and 4 if x was the 2nd column (0-based) of the input and y was the 4th column. Note that “group by y, x” is encoded exactly the same way. “select distinct” will

Re: How to check for SELECT DISTINCT ...?

2016-05-13 Thread Julian Hyde
By the time the query is translated into relational algebra, SELECT DISTINCT will have been converted into an Aggregate with no aggregate functions. So, for instance, select distinct deptno from emp and select deptno from emp group by deptno will be indistinguishable if you look at the