FeedOptions.EnableLowPrecisionOrderBy属性的作用是什么(What is the effect of FeedOptions.EnableLowPrecisionOr

编程入门 行业动态 更新时间:2024-10-21 23:17:13
FeedOptions.EnableLowPrecisionOrderBy属性的作用是什么(What is the effect of FeedOptions.EnableLowPrecisionOrderBy Property)

Azure DocumentDB .NET SDK文档查询API提供了按精度降低订单的选项,但确切的预期效果仍然不明确。 文档仅说明:

获取或设置Azure DocumentDB数据库服务中启用低精度排序的选项。

ORDER BY子句文档没有说明有关排序行为的信息,具体取决于FeedOptions或结果有时的排序方式与查询中请求的不同。

提到的选项实际上做了什么? 使用“低精度”时我们可以期望什么精度? 我们可以断言超越“低精度”的实际顺序?

Azure DocumentDB .NET SDK document querying API provide option to reduce order by precision but the exact expected effect remains vague. The documentation states only:

Gets or sets the option to enable low precision order by in the Azure DocumentDB database service.

The ORDER BY-clause documentation does not say a word about ordering behavior depending on FeedOptions or results being sometimes ordered differently than requested in query.

What does the mentioned option actually do? What precision can we expect when using "low precision"? What can we assert about the actual order beyond that "low precision"?

最满意答案

Azure Cosmos DB支持改变索引的精度以减少索引的存储占用空间(默认为全精度)。 例如,数字精度为5,该服务将索引数字的前5个字节。

默认情况下,不允许对精度较低的属性进行排序。 但您可以通过设置EnableLowPrecisionOrderBy来选择执行ORDER BY。 假设您选择数字精度为5(对于8字节数字)。 查询结果将按照该数字的最高有效5个字节的顺序排列,但保证其余3个字节没有顺序。 此选项允许您执行快速排序,而无需完全精确索引,例如,当您执行临时数据探索时。

对于大多数用例,您应该使用默认精度,而不必依赖于精度较低的顺序。

Azure Cosmos DB supports varying the precision of your index to reduce the storage footprint of indexing (default is full precision). For example, with a numeric precision of 5, the service would index the first 5 bytes of your number.

By default, sorting a property with a lower precision is disallowed. But you can opt-in to perform an ORDER BY by setting EnableLowPrecisionOrderBy. Let's say you choose a numeric precision of 5 (for an 8-byte number). The query results will be in order based on the most significant 5 bytes of the number, but guarantees no order for the remaining 3 bytes. This option lets you perform fast order by without requiring full precision indexing, for example, when you're performing ad-hoc exploration of data.

For most use cases, you should use the default precision, and not have to rely on the lower precision order by.

EDIT: this is now deprecated, and indexing is by default maximum precision

更多推荐

本文发布于:2023-07-31 01:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340488.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   作用   EnableLowPrecisionOrderBy   FeedOptions   effect

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!