简体   繁体   English

从服务器端缓存/游标一次获取一行,使用Ruby OCI8 gem可能吗?

[英]Is fetching one row at a time, from server-side cache/cursor, using Ruby OCI8 gem possible?

oci8 gem to query a database and fetch the results; oci8 gem查询数据库并获取结果; however, the size of the query's results is unknown and may be too large to cache on an individual's computer. 但是,查询结果的大小未知,可能太大而无法在个人计算机上缓存。 Is there a way to query the database, store the results on the server-side and then fetch each record from that set, one by one? 有没有办法查询数据库,将结果存储在服务器端,然后逐个从该集合中获取每个记录? Any help would be much appreciated. 任何帮助将非常感激。

It is the only way which ruby-oci8 supports. 这是ruby-oci8支持的唯一方式。

All Oracle cursors are server-side cursors. 所有Oracle游标都是服务器端游标。 Fetched records are sent to the client only when the client requests more rows. 仅当客户端请求更多行时,才会将提取的记录发送到客户端。 FIY, maximum number of rows in the client-side cache is limited by OCI8#prefetch_rows= and OCI8::Cursor#prefetch_rows= . FIY,客户端缓存中的最大行数受OCI8#prefetch_rows =OCI8 :: Cursor#prefetch_rows =的限制 The default value is one. 默认值为1。 It is recommended to increase the size to 100 for large data. 对于大数据,建议将大小增加到100。

Note: The default prefetch row size was changed to 100 in ruby-oci8 2.2.0. 注意:默认预取行大小在ruby-oci8 2.2.0中更改为100。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM