Subject | Re: [firebird-support] Performance of long GROUP BY clause |
---|---|
Author | Ann W. Harrison |
Post date | 2006-05-02T21:41Z |
Rick Debay wrote:
efficiently in 1.5. maybe this one will be done correctly in 2.0 - I
haven't tried. The advantage of using the (less elegant) aggregates
on string fields with a 1:1 correspondence with grouping fields is that
the performance impact is approximately nothing. I doubt that the
optimizer is good enough to notice that the whole join is unnecessary
and the field values requested are already produced by the initial
grouping.
Regards,
Ann
> Are you planning on using FB 2?A problem is that joins of views with groups are not done particularly
>
> Select *
> From
> (select a.id from Atable a group by a.id)
> join descriptive_table d on d.Atable_id = a.id
>
> I'd make the main query a view if it were useful elsewhere (although
> views are hard to maintin in firebird) and then this kind of join could
> be done in FB 1.5 as well.
efficiently in 1.5. maybe this one will be done correctly in 2.0 - I
haven't tried. The advantage of using the (less elegant) aggregates
on string fields with a 1:1 correspondence with grouping fields is that
the performance impact is approximately nothing. I doubt that the
optimizer is good enough to notice that the whole join is unnecessary
and the field values requested are already produced by the initial
grouping.
Regards,
Ann