Michael,
You are right - the cycle savings are minimal - usually because once the GROUPing is
done - there aren't very many rows to be returned and sorting a few hundred of even a
few thousand of them is pretty instantaneous.
It's really mostly philosophical - when you only specify GROUP BY -
[EMAIL PROTECTED] wrote:
Guys - I think this fusing of GROUP BY and ORDER BY is a bad thing - even if
it works. GROUP should group and if you want an order - add an ORDER clause
explicitly. Yes, the GROUP BY does a sort and you are tempted to leverage it,
but it could lead to problems.
It may not
Guys - I think this fusing of GROUP BY and ORDER BY is a bad thing - even if it works.
GROUP should group and if you want an order - add an ORDER clause explicitly. Yes, the
GROUP BY does a sort and you are tempted to leverege it but it could lead to problems.
It may not be visible in
At 06:30 PM 5/24/2004, [EMAIL PROTECTED] wrote:
Guys - I think this fusing of GROUP BY and ORDER BY is a bad thing - even
if it works. GROUP should group and if you want an order - add an ORDER
clause explicitly. Yes, the GROUP BY does a sort and you are tempted to
leverege it but it could lead
Hi all.
I've noticed that if I do a 'group by xxx' I get the results sorted by
xxx ( when I'm only grouping on 1 field ).
It seems to happen that way every single time.
Is this faster than doing both a 'group by' and 'sort by', and is it
something I can rely on?
Just curious...
Dan
--
Daniel
At 06:29 PM 5/23/2004, you wrote:
Hi all.
I've noticed that if I do a 'group by xxx' I get the results sorted by xxx
( when I'm only grouping on 1 field ).
It seems to happen that way every single time.
Is this faster than doing both a 'group by' and 'sort by', and is it
something I can rely on?
It's right there in the manual http://dev.mysql.com/doc/mysql/en/SELECT.html:
| If you use GROUP BY, output rows are sorted according to the GROUP BY
| columns as if you had an ORDER BY for the same columns. MySQL has extended
| the GROUP BY clause as of version 3.23.34 so that you can also