indexing - mysql fulltext index is used for MATCH() AGAINST but not for = -


my table xm_c created this:

 create table `xm_c` (     `category_id` char(16) not null default '',     `label` char(64) not null default '',     `flags` smallint(5) unsigned default null,     `d0` date default null,     `d1` date default null,     `ct` int(6) unsigned default null,     `t_update` timestamp not null default current_timestamp on update current_timestamp,      primary key  (`category_id`),     **fulltext key `label` (`label`)**   ) engine=myisam default charset=latin1 delay_key_write=1;  

the fulltext index not used in query below:
select * xm_c label = 'tomcruise';

where used here:
select * xm_c match(label) against('tomcruise');


 mysql> explain select * xm_c match(label) against('tomcruise');    >   id | select_type | table | type | possible_keys | key  | key_len | ref  | rows |    **1 | simple      | xm_c  | fulltext | label     | label | 0      |      |    1 | using where**      mysql> explain select * xm_c label = 'tomcruise';    > id | select_type | table | type | possible_keys | key  | key_len | ref  | rows    |   **1 | simple      | xm_c  |  | label         | null | null    | null | 5673360 | using where**    

can explain this? shouldn't index used in both queries?
there syntax constraint in using fulltext indices?

a full text index can used in match() ... against operations. = operator different , has nothing fts, can't use type of index. more information fts can found in manual.

a horse uses horseshoes, car uses tyres. , both can bring b.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -