On Feb 6, 2008 11:20 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> On Feb 6, 2008 10:59 PM, Andrew Ballard <[EMAIL PROTECTED]> wrote:
>
> > Of course, in this case you could just avoid all the confusion with
> > this statement as well:
> >
> > SELECT DISTINCT name, size
> > FROM    wine
>
> im not sure why, but i think distinct is typically way slower than group by.
>
> -nathan
>

I can't really say for MySQL, but in my experience I'd say "it
depends." It seems to me that for this case they should be about the
same, as it's always been my thinking that GROUP BY did a DISTINCT
implicitly. However, I don't really know the internals of any DB
platform so I can't confirm that. I ran DESCRIBE on a couple different
tables, and they both return the same plan. I don't see any notable
difference in the queries either. However, I'll leave it to the OP to
test and see if one is better for his question.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to