On 12-07-02 09:33 PM, yoku ts wrote:
Hello,
add index to expression1_id and expression2_id on expression_expression.
it doesn't use index,following,
WHERE
ee2.expression1_id = $ID
OR
ee1.expression2_id = $ID
Thank you for your reply. The table already has indexes on these
columns, however:
mysql db_lexi > show index from expression_expression\G
*************************** 1. row ***************************
Table: expression_expression
Non_unique: 0
Key_name: PRIMARY
Seq_in_index: 1
Column_name: id
Collation: A
Cardinality: 106191
Sub_part: NULL
Packed: NULL
Null:
Index_type: BTREE
Comment:
*************************** 2. row ***************************
Table: expression_expression
Non_unique: 1
Key_name: expression2_id_idx
Seq_in_index: 1
Column_name: expression2_id
Collation: A
Cardinality: 106191
Sub_part: NULL
Packed: NULL
Null:
Index_type: BTREE
Comment:
*************************** 3. row ***************************
Table: expression_expression
Non_unique: 1
Key_name: type_lien_id_idx
Seq_in_index: 1
Column_name: type_lien_id
Collation: A
Cardinality: 43
Sub_part: NULL
Packed: NULL
Null: YES
Index_type: BTREE
Comment:
*************************** 4. row ***************************
Table: expression_expression
Non_unique: 1
Key_name: expression1_id_idx
Seq_in_index: 1
Column_name: expression1_id
Collation: A
Cardinality: 106191
Sub_part: NULL
Packed: NULL
Null:
Index_type: BTREE
Comment:
4 rows in set (0.23 sec)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql