什么是Google Appengine Ndb GQL查询最大限制?

时间:2020-11-29 23:12:52

I am looking around in order to get an answer what is the max limit of results I can have from a GQL query on Ndb on Google AppEngine. I am using an implementation with cursors but it will be much faster if I retrieve them all at once.

我正在环顾四周,以便得到答案我可以从Google AppEngine上的Ndb上的GQL查询获得的结果的最大限制。我正在使用带有游标的实现,但如果我一次检索它们会更快。

2 个解决方案

#1


7  

Basically you don't have the old limit of 1000 entities per query anymore, but consider using a reasonable limit, because you can hit the time out error and it's better to get them in batches so users won't wait during load time.

基本上你不再有每个查询1000个实体的旧限制,但考虑使用合理的限制,因为你可以点击超时错误,最好分批获取它们,这样用户就不会在加载时间内等待。

#2


9  

This depends on lots of things like the size of the entities and the number of values that need to look up in the index, so it's best to benchmark it for your specific application. Also beware that if you find that on a sunny day it takes e.g. 10 seconds to load all your items, that probably means that some small fraction of your queries will run into a timeout due to natural variations in datastore performance, and occasionally your app will hit the timeout all the time when the datastore is having a bad day (it happens).

这取决于许多因素,例如实体的大小和需要在索引中查找的值的数量,因此最好针对您的特定应用程序对其进行基准测试。还要注意,如果你在晴天发现它需要,例如加载所有项目需要10秒钟,这可能意味着由于数据存储区性能的自然变化,您的一小部分查询会遇到超时,有时候当数据存储区出现糟糕的一天时,您的应用程序会一直处于超时状态(它发生了)。

#1


7  

Basically you don't have the old limit of 1000 entities per query anymore, but consider using a reasonable limit, because you can hit the time out error and it's better to get them in batches so users won't wait during load time.

基本上你不再有每个查询1000个实体的旧限制,但考虑使用合理的限制,因为你可以点击超时错误,最好分批获取它们,这样用户就不会在加载时间内等待。

#2


9  

This depends on lots of things like the size of the entities and the number of values that need to look up in the index, so it's best to benchmark it for your specific application. Also beware that if you find that on a sunny day it takes e.g. 10 seconds to load all your items, that probably means that some small fraction of your queries will run into a timeout due to natural variations in datastore performance, and occasionally your app will hit the timeout all the time when the datastore is having a bad day (it happens).

这取决于许多因素,例如实体的大小和需要在索引中查找的值的数量,因此最好针对您的特定应用程序对其进行基准测试。还要注意,如果你在晴天发现它需要,例如加载所有项目需要10秒钟,这可能意味着由于数据存储区性能的自然变化,您的一小部分查询会遇到超时,有时候当数据存储区出现糟糕的一天时,您的应用程序会一直处于超时状态(它发生了)。