List:General Discussion« Previous MessageNext Message »
From:Graeme B. Davis Date:March 30 2000 6:27pm
Subject:Indexing problem
View as plain text  
I have the following indexes on a table and I'm wondering why my query isn't
using the indexes I created?

Any ideas?

Thanks!

graeme

-------------------

mysql> show index from remedy;
+--------+------------+------------------+--------------+-------------+-----
------+-------------+----------+
| Table  | Non_unique | Key_name         | Seq_in_index | Column_name |
Collation | Cardinality | Sub_part |
+--------+------------+------------------+--------------+-------------+-----
------+-------------+----------+
| remedy |          1 | teamsubmitter    |            1 | team        | A
|        NULL |        5 |
| remedy |          1 | teamsubmitter    |            2 | submitter   | A
|        NULL |     NULL |
| remedy |          0 | k_ticket         |            1 | ticket      | A
|      351611 |     NULL |
| remedy |          1 | statusassignedto |            1 | status      | A
|        NULL |     NULL |
| remedy |          1 | statusassignedto |            2 | assignedto  | A
|        NULL |     NULL |
+--------+------------+------------------+--------------+-------------+-----
------+-------------+----------+
5 rows in set (0.01 sec)

mysql> EXPLAIN SELECT ticket, status, assignedto FROM remedy WHERE
assignedto='person' AND status!='Closed';
+--------+------+---------------+------+---------+------+--------+----------
--+
| table  | type | possible_keys | key  | key_len | ref  | rows   | Extra
|
+--------+------+---------------+------+---------+------+--------+----------
--+
| remedy | ALL  | NULL          | NULL |    NULL | NULL | 351611 | where
used |
+--------+------+---------------+------+---------+------+--------+----------
--+
1 row in set (0.00 sec)


Thread
Please help. Sql joins.Andrey Muratov30 Mar
  • Indexing problemGraeme B. Davis30 Mar
  • Re: Indexing problemGraeme B. Davis30 Mar
  • Re: Indexing problemJan Dvorak31 Mar
    • Re: Indexing problemAndreas Pardeike31 Mar
      • Re: Indexing problemJan Dvorak31 Mar
        • Re: Indexing problemAndreas Pardeike31 Mar
          • Re: Indexing problemJan Dvorak31 Mar