innodb_ft_min_token_size = 1性能影响 [英] innodb_ft_min_token_size = 1 performance implications

查看:1119
本文介绍了innodb_ft_min_token_size = 1性能影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将innodb_ft_min_token_size = 1从默认值3更改,这会导致更多的磁盘使用吗?搜索是否有性能问题?

If I change innodb_ft_min_token_size =1 from default of 3, will this cause a lot more disk usage? Any performance issues with search?

我希望能够使用1个字符的全文本搜索.

I want to be able to use fulltext search in 1 character in words.

此外,一旦我进行了更改,我将如何重建索引?这会给服务器带来很多负担吗?

Also once I make this change how would I rebuild the index? Will this put a lot of load on server?

推荐答案

1和2个字母的单词并不多,因此空格的变化可能不会那么大.

There are not that many 1- and 2- letter words, so the space change may not be that great.

在my.cnf中修改innodb_ft_min_token_size,innodb_ft_max_token_size或ngram_token_size要求重新启动服务器.

Modifying innodb_ft_min_token_size, innodb_ft_max_token_size, or ngram_token_size [in my.cnf] requires restarting the server.

要为InnoDB表重建FULLTEXT索引,请使用带有DROP INDEX和ADD INDEX选项的ALTER TABLE删除并重新创建每个索引.

To rebuild FULLTEXT indexes for an InnoDB table, use ALTER TABLE with the DROP INDEX and ADD INDEX options to drop and re-create each index.

- https://dev.mysql .com/doc/refman/8.0/en/fulltext-fine-tuning.html

范围" innodb_ft_min_token_size的"0"是全局".也就是说,它适用于所有InnoDB FT索引.

The "Scope" of innodb_ft_min_token_size is "Global". That is, it applies to all InnoDB FT indexes.

- https://dev.mysql .com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_ft_min_token_size

重新创建索引将读取整个表并重新构建FT索引,从而将FT索引锁定".该表在一段时间内处于某个级别.重建时间将与表的大小大致成比例.在完成之前,它将消耗大量额外的磁盘空间. (将复制表和所有索引,并至少重建FT索引.)

Recreating the index will read the entire table and rebuild the FT index, which will "lock" the table at some level for some period of time. The time to rebuild will be roughly proportional to the size of the table. And it will consume a bunch of extra disk space until it is finished. (The table and all the indexes will be copied over and at least the FT index will be rebuilt.)

如果有一千行,没什么大不了的.如果您有十亿行,则将需要较长的停机时间".

If you have a thousand rows, no big deal. If you have a billion rows, you will need a long "downtime".

更改innodb_ft_max_token_size后,我会害怕进行简短的通配符测试,例如

After changing the innodb_ft_max_token_size, I would be afraid to do a short wildcard test like

AGAINST('a*' IN BOOLEAN MODE)

如果您有测试服务器,只需尝试一下即可.

If you have a test server, simply try it.

我注意到文档建议中文为1等.

I noticed that the documentation recommends a value of 1 for Chinese, etc.

这篇关于innodb_ft_min_token_size = 1性能影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆