Forum: Ruby on Rails OCI adapter slowdown on dictionary access

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andreas G. (Guest)
on 2006-02-07 17:55
(Received via mailing list)
Hi,

after some experience with Rails on MySQL databases I gave it a try on
one
of our larger Oracle database.
I was facing a problem when Rails tried to detect the columns for a
model/table. The appropriate statement ran about 1 min which led to a
timeout.
Our Oracle guru told me to analyze the SYSTEM schema. After that hadn't
helped, he said the only remaining chance is to use a hint in the
statement. Other tools like TOAD would do it by themself anyway...

I made the change in oci_adapter.rb and Rails was responsive again. If
anybody else has this problem or if anybody wants to include the change
into the next ActiveRecord version, here is what I've changed:

in
activerecord-1.13.2/lib/active_record/connection_adapters/oci_adapter.rb
at line 341 (in the #columns method):
- select column_name, data_type, data_default, nullable,
+ select /*+ RULE */ column_name, data_type, data_default, nullable,

Best regards and thanks for the great framework,
Andreas G.
Alex Y. (Guest)
on 2006-02-07 17:58
(Received via mailing list)
Andreas G. wrote:
> in activerecord-1.13.2/lib/active_record/connection_adapters/oci_adapter.rb
> at line 341 (in the #columns method):
> - select column_name, data_type, data_default, nullable,
> + select /*+ RULE */ column_name, data_type, data_default, nullable,
You'll have to excuse my ignorance, having had no deep exposure to
Oracle:  what does that actually do?
This topic is locked and can not be replied to.