Re: Re: MySQL index question

Jeffrey L. Taylor
Tue, 20 Jul 2010 15:15:33 -0000

Quoting Frederick Cheung
<frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> On Jul 20, 3:55 pm, "Jeffrey L. Taylor"
<r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:
> >
> > mysql> EXPLAIN EXTENDED SELECT * FROM tokens WHERE
6813946236211560448 <= fnv AND fnv < 6818449835838930944 AND
updated_at<''2010-06-20 14:08:55'' AND occurrences=0;
> >
+----+-------------+--------+-------+--------------------------------------
------------------+---------------------------------+---------+------+-----
-+-------------+
> > | id | select_type | table  | type  | possible_keys
                       | key                             | key_len | ref  | rows
| Extra       |
> >
+----+-------------+--------+-------+--------------------------------------
------------------+---------------------------------+---------+------+-----
-+-------------+
> > |  1 | SIMPLE      | tokens | range |
index_tokens_on_fnv_and_user_id,updated_at,occurrences |
index_tokens_on_fnv_and_user_id | 8       | NULL | 6153 | Using where |
> >
+----+-------------+--------+-------+--------------------------------------
------------------+---------------------------------+---------+------+-----
-+-------------+
> > 1 row in set, 1 warning (0.00 sec)
>
> Yup, that is just using the index on fnv.
>
> Fred
>

Fred,
  Thank you.  Deleting the other indexes should speed up writes.