Hi,

...
> 1. COUNT(*) Is there anything wrong with using
>     SELECT COUNT(*)
>     FROM bleah
> or should I be using
>     SELECT COUNT(someField)
>     FROM bleah

COUNT(*) might be faster. Its possible that it reads the count from internal
table while COUNT(someField) needs to make a real query. *I think* there
exist a difference how NULLs are treated (included in count or not). That is
if a row has NULL value in "someField" it might not be included in count.

...
> 2. Is two queries a lot less efficient than one?

Usually yes. But with joins (at least in your example), no. The join(-query)
will create a huge temporary table, from which you only select a few rows.

// Jarmo


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to