Comments (5)
Oracle call interface cannot fetch all rows in a query. Instead it supports prefetching. When a row is fetched, more than one row is retrieved in a network call and stored into a prefetch buffer. The subsequent rows are got from the buffer until it becomes empty. When the buffer is empty, more rows are retrieved by a network call.
Ruby-oci8 prefetches 100 rows by default. See OCI8#prefetch_rows=.
from ruby-oci8.
@kubo I also have a few questions related to what Srikanth asked:
(1) is there a way to set @fetch_array_size ? I am seeing @fetch_array_size = nil in fetch_row_internal() when running simple queries
if I set it to value > 1 in fetch_row_internal() I am getting this error message: /Users/skudryav/RAILS/TOGO/togo/config/initializers/oracle.rb:79:in `__fetch': fetch size (100) != define-handle size 1 (RuntimeError)
If I pass value > 1 as second parameter in @rowbuf_size = __fetch(@con, @fetch_array_size || 1) I am getting the same error message
** by default we have setting prefetch_rows: 500
(2) also seeing that @rowbuf_size is always 1 although we have setting prefetch_rows: 500
Is there some mode in which oci8_stmt_fetch returns/handles more than 1 row?
(3) in fetch_one_row_as_array I am seeing ruby code which it seems iterates via @define_handles
and call C method OCI8::BindType::Base#get_data
Is there a way to do all this in C code in order to improve performance?
** similar to what Postgres adapter does
from ruby-oci8.
@skudryav In our case, we applied the work around described in #230 to set @fetch_array_size to nil always because without it, our apps would consume multiple gigabytes of memory over time, leading them to crash randomly, run very slowly and be unstable in general. There is some kind of memory leak associated with setting @fetch_array_size to a large value. Perhaps Cursor or Statement objects are not being freed correctly in the oci8 code?
from ruby-oci8.
even if I remove this workaround I am still seeing @fetch_array_size = nil in fetch_row_internal()
from ruby-oci8.
@kubo Currently OCI8 fetch_one_row_as_array method does a lot of get_data calls when iterating over list of select columns (~ @define_handles), that's why we are seeing degradation with large number of columns.
Ideally it will be good if some new version of get_data C method will return array of values - so there will be just one call of C method in fetch_one_row_as_array() instead of many.
from ruby-oci8.
Related Issues (20)
- @tiagobzr I didn't get this..Im getting the same error as cited above HOT 3
- warning: undefining the allocator of T_DATA class OraNumber HOT 1
- Question regarding a thread issue that was potentially fixed HOT 1
- extconf.rb failed when installing ruby-oci8 on M1 Mac. HOT 3
- sql_type: Number(1) is getting mapped to Boolean HOT 1
- OCIError: ORA-21500 when connecting to Oracle Database 18c Enterprise Edition HOT 2
- Query : Is ruby-oci8 gem version 2.2.12 broken on Windows (with Ruby 2.5.x)? HOT 4
- Issues during gem install with M1 running on Rosetta (Oracle instant client is not found. (RuntimeError)) HOT 5
- fails to load oci.dll on windows x64/msys2 rub 3.1.4p223 after update of msys2 HOT 5
- Install on M1 HOT 3
- Plans for arm (Mac M1 to be exact)? HOT 22
- "UTF8" to "CESU-8" mapping HOT 1
- ruby-oci8-2.2.12/lib/oci8lib_320.so (LoadError) HOT 3
- M3 Mac Ruby OCI8 installation issue HOT 2
- XML data type question HOT 1
- ORA-28041: authentication protocol internal error HOT 3
- Segmentation fault after 2.2.12 → 2.2.13 update (x86_64-linux) HOT 6
- Crashing on Mac M1 HOT 4
- Error when using ruby-oci8 with rodauth-rails and sequel-activerecord_connection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-oci8.