英文:
Cursor equivalent for Gemfire?
问题
我使用 Gemfire 8.x,我有一个 Gemfire 区域,其中有许多对象(假设有数十亿个),我需要编写一些 Java 代码,从该区域获取一个巨大的结果集并进行一些批处理。
如果这是传统的关系型数据库,我会使用游标来实现,以避免出现 OutOfMemoryError。在 Gemfire 中是否有类似的解决方案?还是说我必须实现某种自定义分页逻辑,使用 OQL 中的 LIMIT
关键字来处理这种大结果集的批处理?
英文:
I use Gemfire 8.x and I have a Gemfire region where there are many objects in it (let's say there are billions of them) and I need to write some Java code which does some kind of bulk processing with a huge result set from the region.
If it was a traditional RDBMS, I would use a cursor for that so that I won't get an OutOfMemoryError. Is there an equivalent in Gemfire? Or do I have to implement some kind of custom paging logic with the LIMIT
keyword in OQL for implementing this kind of bulk processing with a large result set?
答案1
得分: 1
在GemFire中,没有CURSOR
的等价物,您需要使用LIMIT
来检索结果。顺便提一下,编写一个自定义Function可能会更有益(而且可能更好),而不是从客户端应用程序使用OQL
,这将允许您在原地处理数据并防止整个数据集移动到客户端。
干杯。
英文:
There's no CURSOR
equivalent in GemFire
, you need to retrieve the results using LIMIT
instead. As a side note, it would be beneficial (and probably better) to write a custom Function instead of using OQL
from a client application, that will allow you to process the data in place and prevent the whole data set from moving to the client side.
Cheers.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论