>>>> why does mysql use group_id index ?
>>> because in this case group_id would be faster than user_id
>> but in fact group_id is very slow (51.21 sec), user_id is (0.00 sec)
>
> ok, at least MySQL does think so
I know, but I what I really want to know is how does mysql think so ?
>
>>>> how to let mysql choose user_id as an index ? what's the mean of 'rows' ?
>>> valid rows after applying the WHERE to this index
>> the result is empty set, if what you said is true, then the rows must be
>> 0 ?
>
> no, not the final result, only for this index
>
> read about EXPLAIN in the MySQL manual
>
> http://dev.mysql.com/doc/refman/5.0/en/using-explain.html
I has read it , and it described like what you said, I don't really know
what is the mean of 'only for this index',
I tried 'select count(*) from photo where group_id=0 and album_id!=0,'
ant it get a huge number, but not the value of rows.
>
> -- 
> Sebastian
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>

-- 

Thanks & Regards

Changying Li


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to