List:General Discussion« Previous MessageNext Message »
From:Fred Lindberg Date:May 16 1999 7:39pm
Subject:Re: Hm... why?
View as plain text  
On Sun, 16 May 1999 22:02:57 +0300, Mark Papadakis wrote:

>mysql> select sum(points) from mt where mt.wid<100 limit 10;
>Over 10 mins, got bored waiting to return and i stopped it.

from the fact that the first query took several seconds it is obvious
that the table is very large [relative the system]. The second query
sums _all_ rows with mt.wid < 100. Limit is applied to the result set,
in this case only one (the sum). Thus, the first query stops after
finding 10 rows matching. The second stops only after finding all
matching rows.

-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)

Hm... why?Mark Papadakis16 May
  • Hm... why?Michael Widenius22 May
  • Hm... why?Michael Widenius22 May
Re: Hm... why?Fred Lindberg16 May
RE: Hm... why?Paul Smith22 May
  • RE: Hm... why?Michael Widenius28 May