简体   繁体   English

元素值查询与元素范围查询的性能

[英]performance of element-value-query vs element-range-query

I have an element range index configured for an element in my database. 我有一个为我的数据库中的元素配置的元素范围索引。 I am trying to run a search query on that element. 我正在尝试对该元素运行搜索查询。 The element contains string values and i need to search for one particular string value (not a range of values or date). 该元素包含字符串值,我需要搜索一个特定的字符串值(不是值的范围或日期)。 Though both element-value and element-range queries can be used, and index is already present, Will both these queries perform in same way? 虽然可以使用元素值和元素范围查询,并且索引已经存在,但这两个查询是否会以相同的方式执行? or element-range performs better in this scenario? 或者元素范围在这种情况下表现更好?

The range query will be faster. 范围查询将更快。

The element value query uses the universal index and that isn't full in memory 元素值查询使用通用索引,并且在内存中未满

The range query users a ranged index and that's an in memory index. 范围查询使用范围索引和内存索引。

The range query will be much faster as your data grows. 随着数据的增长,范围查询将更快。 It will also be faster if you have a lot of unique terms in that element. 如果你在该元素中有很多独特的术语,它也会更快。

The range-query is also answering a different question from the value-query. 范围查询还回答了值查询中的不同问题。

Value queries query for matching word sequences, not matching strings. 值查询查询匹配的单词序列,而不是匹配的字符串。 By default they are stemmed too, so cts:element-value-query(xs:QName("x"),"be fine") will match <x>Is finer</x> . 默认情况下它们也被阻止,因此cts:element-value-query(xs:QName(“x”),“be fine”)将匹配<x>Is finer</x> Unless you do an exact unstemmed unwildcarded value query, an unfiltered search will not be able to resolve space and punctuation differences, either. 除非您执行精确的未受干扰的非wildcarded值查询,否则未经过滤的搜索也无法解决空格和标点符号差异。

Range queries (on strings) are matching strings under the rules of a particular collation. 范围查询(在字符串上)是特定排序规则下的匹配字符串。

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

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