简体   繁体   English

MySQL-更改myIsam表上的索引

[英]MySQL - Change index on myIsam table

I have a table where two columns are used in a where condition. 我有一个表,其中在where条件中使用两列。

This is a MyIsam table and both columns hold text and use FULLTEXT as index. 这是一个MyIsam表,两列均包含文本,并使用FULLTEXT作为索引。

The values in both columns are not unique. 两列中的值都不都是唯一的。

The select statement works pretty slow. select语句的运行速度非常慢。

Question is: can I simply remove the FULLTEXT index and use another index instead? 问题是:我可以简单地删除FULLTEXT索引并改用另一个索引吗?

The query that is used is just as simple as possbile: 使用的查询与possbile一样简单:

SELECT * FROM tbl WHERE col1=X AND col2=y and col3=z

Thanks! 谢谢!

ALTER TABLE  `tableName` DROP INDEX  `indexName` ,
ADD INDEX  `indexName` (  `ColName` )

This shuld remove the old "FULLTEXT" index and add a "NOT FULTEXT" index. 这将删除旧的“ FULLTEXT”索引,并添加“ NOT FULTEXT”索引。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM