我的分类Comapny
的属性为name
。在这个属性上,我有一个FULLTEXT SBTREE
索引。我使用全文索引来搜索公司名称select from Company where name containstext 'foo' order by name
中的子字符串
当我按select from Company order by name limit 25
执行查询时查询不使用此索引
我使用错误的索引类型吗?
谢谢。
info property company.name
PROPERTY 'Company.name'
Type.................: STRING
Mandatory............: true
Not null.............: true
Read only............: false
Default value........: null
Minimum value........: null
Maximum value........: null
REGEXP...............: null
Collate..............: {OCaseInsensitiveCollate : name = ci}
Linked class.........: null
Linked type..........: null
INDEXES (1 altogether)
+----+------------+----------+
|# |NAME |PROPERTIES|
+----+------------+----------+
|0 |Company.name|[name] |
+----+------------+----------+
INDEXES
+----+------------------+--------------------+-------+---------+-------+-----------------+
|# |NAME |TYPE |RECORDS|CLASS |COLLATE|FIELDS |
+----+------------------+--------------------+-------+---------+-------+-----------------+
|2 |Company.name |FULLTEXT |17648 |Company |ci |name(STRING) |
explain select from Company order by name limit 25
{
"@type": "d",
"@version": 0,
"fullySortedByIndex": false,
"documentReads": 8447,
"current": "#80:2119",
"documentAnalyzedCompatibleClass": 8447,
"recordReads": 8447,
"fetchingFromTargetElapsed": 49,
"indexIsUsedInOrderBy": false,
"orderByElapsed": 48,
"evaluated": 8447,
"user": "#5:3",
"elapsed": 97.22936,
"resultType": "collection",
"resultSize": 25,
"@fieldTypes": "documentReads=l,current=x,documentAnalyzedCompatibleClass=l,recordReads=l,fetchingFromTargetElapsed=l,orderByElapsed=l,evaluated=l,user=x,elapsed=f"
}