【发布时间】:2021-06-16 09:31:04
【问题描述】:
我有这么长的文本,超过了索引的字节限制。 文本没有任何空格。它是 dbname 和 table_name 之类的组合。
我将只查询完全相同
select * from table where column='text'
或者
如果我使用全文搜索,它可能会这样。
select * from table where Match (column) Against(text)
我不知道以下两个选项中哪一个最好。
我将使用text_example = '{dbName}/{tableName}' 进行解释,但实际上,它是至少 5 种字符串的组合。
选项1。使用全文搜索
选项2。使用索引 要使用索引,我必须将 text_example 拆分为 5 种类型。然后为每种类型创建索引。
create table info (
dbName text,
tableName text,
index dbIdx (dbName),
index tableIdx (tableName)
);
经常插入查询。
在这种情况下,哪一个是最好的存储方面? 性能怎么样?
或者有没有什么好的方法来改进带有这么长文本的选择查询? 仅供参考,我使用 mysql 8.0
【问题讨论】:
标签: mysql indexing full-text-search full-text-indexing fulltext-index