查询随结果集的大小而不是数据集的大小而缩放 [英] Queries scale with the size of your result set, not the size of your data set

查看:20
本文介绍了查询随结果集的大小而不是数据集的大小而缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于最新的 Firebase Cloud Firestore 的问题.在这个文档中它是这样说的:

This is a question about the latest Firebase Cloud Firestore.In this doc it says like this:

它还允许表达查询.查询规模与大小你的结果集,而不是你的数据集的大小,所以你会得到相同的从一组 100 个或 100,000,000 个结果中提取 1 个结果的性能.

It also allows for expressive queries. Queries scale with the size of your result set, not the size of your data set, so you'll get the same performance fetching 1 result from a set of 100, or 100,000,000.

这个陈述对我来说不是很清楚.你能稍微解释一下这个用例吗?

This statement is not clear for me. Can you explain little bit more about this use case?

推荐答案

这可能写得有点混乱.它不是经典意义上的用例,它只是关于 Firestore 性能的陈述.

This may be written a bit confusing. It is not a use-case in the classic sense its just a statement about the performance of Firestore.

它基本上是说,如果您请求 100 件中的 1 件或 100.000.000 件中的 1 件,都一样快.这里 1 是您的结果集,100/100.000.000 是您的数据集.因此,从 100.000.000 中请求 1 项将比从​​ 100 项中请求 50 项更快.

It basically says that it does not matter if you request 1 item out of a 100 or 1 item out of 100.000.000, it will be equally fast. Here 1 is your result set and 100/100.000.000 is your data set. So requesting 1 item out of 100.000.000 will be faster than requesting 50 items out of 100.

我希望这能让它更清楚一点!

I hope this makes it a bit clearer!

这篇关于查询随结果集的大小而不是数据集的大小而缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆