Hello.


>I am not sure if the key is only built on a single col ( I added



Use SHOW INDEX or SHOW CREATE TABLE statements. See:

  http://dev.mysql.com/doc/mysql/en/show-index.html

  http://dev.mysql.com/doc/mysql/en/show-create-table.html

  

I think you should send your query, the output of EXPLAIN

statement and the definitions of your tables which are used by query.



  



Ginger Cheng <[EMAIL PROTECTED]> wrote:

> Hello, MySQL gurus,

>       I have a non-unique key of 2 columns, the 1st is a varchar(15), 

> 2nd is a int(10) unsigned. But when I 'explain' a query that uses this 

> key,  the key_len is only 15 with the key name shown up in the 'key' 

> column of this table correctly though. According to the manual, that 

> means how many columns of a key is accually used in the query. So the 

> query is only using the 1st column of my key although it could not be   

> efficient without using the 2nd column.

>       I am not sure if the key is only built on a single col ( I added 

> the index as 'ALTER TABLE  a  ADD INDEX (f, s)') or it is the MySQL 

> optimizer that decides it will only use the 1st column of the key. Is 

> there any way to check and get it right?

>       Thank you all for help

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to