Subject [firebird-support] Re: question about optimizing group by
Author Svein Erling Tysvær
Ann will hopefully answer the rest of your questions, I just have a comment/question.

I assume that when you say you got quite different results, then we're talking about more than a 2% speed difference and that you ran both options several times so that the first one didn't use cache whereas the second could benefit from a query just run. Did you check that the plans when running these two statements were identical/similar? A small change (adding a join to a tiny table, a slight change in the where clause etc.) can make the optimizer change its "mind" about how to do things and come up with a completely different plan.

I think it would be nice if you could show us your actual statements, the plans generated and some information about the indexes used (which fields they refer to, and whether those fields are selective or not). Also, please tell us what quite different results mean.

Set

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of woodsmailbox
Sent: 23. november 2008 16:48
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: question about optimizing group by

And why I'm asking: If indeed, the speed isn't affected by the number
and size of columns in the group-by clause (and whether there are
compound indexes or not on those columns), then I wouldn't be looking
for a solution. But that's exactly what I'm not convinced of yet,
since I got quite different results with the different alternatives I
tried.