Re: 50.000 records, 2 values and 1.5 s to find out?!!
| From: | andy | Date: | Wed, 22 May 2002 16:46:24 +0000 |
| Subject: | Re: 50.000 records, 2 values and 1.5 s to find out?!! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19364@lists.php.net to get a copy of this message | ||
oh... on MySQL
"Andy" <news.letters@gmx.de> schrieb im Newsbeitrag
news:20020522164220.82315.qmail@pb1.pair.com...
> Hi there,
>
> I have a user table, containing a column on gender. Type is tinyint(1) and
1
> is male 2 is female. No index. 50000 entries
>
> This statement:
> SELECT sex, count(*) AS c
> FROM user GROUP BY sex
>
> takes 1.5 s to execute
>
> I am wondering if ti wuold be possible to find this out any faster ?
>
> SELECT count(*) AS c
> FROM .user
> where sex = 1
>
> takes about half the time :-)
>
> So maybe some of you guys do have some experiance on that. This is just
way
> to long.
>
> I appreciate every help on that,
>
> Thanx in advance, Andy
>
>