I’m just looking into how to connect to Oracle using Rails. I’ve got
everything connecting and working as it should.
I have a Users table in Oracle:
create_table “users”, :force => true do |t|
t.column “username”, :string
t.column “created_on”, :datetime
t.column “email”, :string
t.column “note”, :text
end
And everything works fine, but in development, it has to run this query
for each view
select column_name, data_type, data_default, nullable,
decode(data_type, ‘NUMBER’, data_precision,
‘VARCHAR2’, data_length,
null) as length,
decode(data_type, ‘NUMBER’, data_scale, null) as scale
from user_catalog cat, user_synonyms syn, all_tab_columns col
where cat.table_name = ‘USERS’
and syn.synonym_name (+)= cat.table_name
and col.table_name = nvl(syn.table_name, cat.table_name)
and col.owner = nvl(syn.table_owner, user)
I am assuming that this is because development mode can’t cache the
models… in production mode it seems to take about 8 seconds the first
time but then it’s really fast.
To test, I’ve placed this into SQLPlus and it takes about 6 seconds to
execute there as well.
Is this something that others are experiencing? I’m seeing 6-7 seconds
delay between requests because of this query running on all of my view
pages. Is there something that can be done or is the price of doing
business with Oracle?
Brian H.
Web D.
Learning & Technology Services
Schofield 3-B
University of Wisconsin-Eau Claire
715 836 3585
[email protected]