Hi there,

I do have a user table with 38000 records. Now I would like to count the
female and male users.
This query:

SELECT sex, count(*) AS c
FROM user GROUP BY sex

works, but takes 0.8 s

So I don't think an index would do some good. There are only two values 1,
and 2

The column type is tynyint(1) and contains 50 % "1" and 50%  "2" values

explains says: using temporary on 38000 rows

So is there a way to do this faster. Choosing a different column type ore
similar stuff?

Thanx for any help,

andy


---------------------------------------------------------------------
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