Setting prefetch_row per query

18 views
Skip to first unread message

Jason Hines

unread,
Jan 24, 2013, 11:34:34 AM1/24/13
to oracle-...@googlegroups.com
In my Rails app, I have a need to query a large dataset where it would be ideal to increase the prefetch_rows default for this statement only.

How can this be done using OracleEnhancedAdapter?  I'm currently doing this:

conn = ActiveRecord::Base.connection
cursor = conn.execute(sql)
cursor.prefetch_rows = 1000
while row = cursor.fetch
  #
end

But I am not sure this is working.  Is there a better way?

Thanks.
Reply all
Reply to author
Forward
0 new messages