i was mistaking before, query is more like :
SELECT MyField, count(id) from MyRec where string_field="somestring" group by field;
and it's explain is :
+---------+------+---------------+--------+---------+--------+--------+-------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+---------+------+---------------+--------+---------+--------+--------+-------------+
| MyRec| ref | MyField | MyField | 21 | const | 151609 | Using where |
+---------+------+---------------+--------+---------+--------+--------+-------------+
takes about minute and a half.
----- Original Message ----- From: "Michael Stassen" <[EMAIL PROTECTED]>
To: "Dan Sashko" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, November 10, 2004 6:01 PM
Subject: Re: SELECT on string
What does
EXPLAIN SELECT * from rec where string_field='somestring';
say?
Michael
Dan Sashko wrote:
hi i have a recordset of about 4 mil records,
SELECT * from rec where string_field="somestring"
takes very long time (30+ sec). string_field is indexed MUL. Is there way to make it faster?
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]