Subject Re: [firebird-support] question about optimizing group by
Author Alexandre Benson Smith
woodsmailbox wrote:
> Hi,
>
> Question: does firebird optimizer knows to optimize something like:
>
> select t.pri_key, t.other_field
> from t
> group by t.pri_key, t.other_field
>
> in the sense that it should ignore t.other_field from the sorting
> table?
>
> I have seen advice to use max(t.other_field) to avoid grouping by
> t.other_field.
>
> In that case, wouldn't it help to have an aggregate function that
> would just choose the first row in the group? min/max still needs an
> index.
>
> Is there any other workaround for this? Thanx!
>

Perhaps I am just missing the point...

But a group by PK would not group at all

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br