[thelist] multiple rows in the MySQL with same value

Matt Warden mwarden at gmail.com
Thu Jul 31 13:55:30 CDT 2008


On Thu, Jul 31, 2008 at 2:49 PM, Joel D Canfield <joel at bizba6.com> wrote:
> never leave it up to the db to decide. it's so easy (and a good habit)
> to just say 'order  by myhappyfield desc' or whatever. the db shouldn't

I'd agree in 95% of the cases. But if you truly don't care which of
the records you get, then doing an order by will simply be expensive.
Honestly, I don't know how limit works in MySQL, but in general the
database will start sending you the record set as it is prepared. The
exception is when you issue an order by or a group by or another
operation that forces the database to collect the entire result set,
then perform an operation before it can start sending you any records.

-- 
Matt Warden
Cincinnati, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list