Subject Re: [firebird-support] Re: Natural Plan when grouping by 5 indexed columns?
Author Lele Gaifax
Adam wrote:
>>> Why do you need to group by unless you have aggregates or a having
>>> clause?
>> Because one is trying to view the dimension structure?
>
> It does not make sense though.
>
> select a,b,c
> from d
> group by 1,2,3
>
> is exactly the same as
>
> select a,b,c
> from d
> [order by 1,2,3]
>

Not always, in particular when (a,b,c) is not be a "primary key"; the
former is equivalent to

select DISTINCT a,b,c
from d
order by 1,2,3

ciao, lele.