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

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

问题描述

这是一个关于最新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天全站免登陆