Hi,
with a table with 330000 rows, i have the row in 0s using index on term.

mysql> select * from tx where term like 'Britney Spears' ;
+--------+----------------+
| id     | term           |
+--------+----------------+
| 327681 | Britney Spears |
+--------+----------------+
1 row in set (0.00 sec)

mysql> explain select * from tx where term = 'Britney Spears' ;
+----+-------------+-------+-------+---------------+------+---------+-------+------+-------------+
| id | select_type | table | type  | possible_keys | key  | key_len | ref   |
rows | Extra       |
+----+-------------+-------+-------+---------------+------+---------+-------+------+-------------+
|  1 | SIMPLE      | tx    | const | term          | term |     256 | const |   
1 | Using index |
+----+-------------+-------+-------+---------------+------+---------+-------+------+-------------+
1 row in set (0.00 sec)


hope that helps.

Even with lock tables you may have the row fast.

Mathias


Selon Brian Dunning <[EMAIL PROTECTED]>:

> > What is the output of the following:
> > EXPLAIN select * from terms where term like 'Britney Spears' limit 1;
>
> select_type = SIMPLE
> table = terms
> type = range
> possible_keys = term, term_2 (I just created term_2, fulltext)
> key = term (this means it's not using the one I just created?)
> key_len = 255
> ref = NULL
> Extra = Using where
>
> > Also, can you use "=" instead of "like" in your query?
>
> Yes, I made that change and it still works, so I'll leave it.
>
> --
> 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]

Reply via email to