From: Benjamin Stillman Date: July 3 2012 5:13pm Subject: RE: alternative to slow query List-Archive: http://lists.mysql.com/mysql/227765 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I don't see an index for expression.id. -----Original Message----- From: brian [mailto:mysql-list@stripped] Sent: Tuesday, July 03, 2012 12:28 PM To: mysql@stripped Subject: Re: alternative to slow query 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 =3D $ID >> OR >> ee1.expression2_id =3D $ID > Thank you for your reply. The table already has indexes on these columns, h= owever: 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 ________________________________ Notice: This communication may contain privileged and/or confidential infor= mation. If you are not the intended recipient, please notify the sender by = email, and immediately delete the message and any attachments without copyi= ng or disclosing them. LBI may, for any reason, intercept, access, use, and= disclose any information that is communicated by or through, or which is s= tored on, its networks, applications, services, and devices.