简体   繁体   English

在 Cosmos DB 中使用复合索引是否增强了具有多个相等过滤器且没有范围/orderby 过滤器的查询?

[英]Does queries with multiple equality filters and no range/orderby filters enhanced by using Composite Index in cosmos DB?

The indexing policy document explains the composite index is useful when there is minimum of one equality and one range/orderby query.索引策略 文档解释了复合索引在最少有一个相等和一个 range/orderby 查询时很有用。 But it doesn't explain if it's useful when the query have only multiple equality filters and no range/order by filter.但是它没有解释当查询只有多个相等过滤器并且没有过滤器范围/顺序时它是否有用。

The Mongo DB has a equivalent compound index that helps while querying with multiple equality filter and no range filter. Mongo DB 有一个等效的复合索引,有助于在使用多个相等过滤器和无范围过滤器进行查询时提供帮助。

For example the query will be like this.例如,查询将是这样的。

Select * from c where c.FirstName = "Hi" and c.LastName ="Hello" Select * from c where c.FirstName = "Hi" and c.LastName ="Hello"

In the precise query you have as an example it is unlikely to help.在您以精确查询为例,它不太可能有帮助。 It could provide some benefit but you'd have to have data with extreme cardinality such as a time stamp.它可以提供一些好处,但您必须拥有具有极端基数的数据,例如时间戳。

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

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