Forum: Ruby on Rails RE: Re: 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.
60e38de043848f82392062088f191213?d=identicon&s=25 Hogan, Brian P. (Guest)
on 2006-02-07 18:41
(Received via mailing list)
When hints are used, you may run into this:

ERROR:
ORA-03212: Temporary Segment cannot be created in locally-managed
tablespace

It's all about your DB setup.

As for the error you're getting, I sent an older version! My mistake!!
Thanks for pointing that out!!!

Should be

	          table_cols = %Q{
	            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 (select owner, table_name from
#{scope}_catalog where table_name = #{table}) cat,
	                   (select * from #{scope}_synonyms where
synonym_name = #{table}) syn,
	                   (select * from all_tab_columns) col
	             where cat.table_name = #{table}
	               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, #{(scope ==
"all" ? "cat.owner" : "user")}) }


The reason this works is that Oracle will run the subqueries first, and
then run the where cluases on the contents of the subqueries. The
original query actually has 42 steps and the inner most step is a full
table scan on the users table.)

The above query "prefetches" only the rows needed (and could be tuned
more to just include the columns needed).

So far it's working for us.  Our setup is a specific user accessing
their own objects via tables or synonyms.

-Brian Hogan
27c57aaa4bda5ac8b0593659573b522f?d=identicon&s=25 Blair Zajac (Guest)
on 2006-02-07 21:13
(Received via mailing list)
Hogan, Brian P. wrote:
>
> 	              from (select owner, table_name from
>
> their own objects via tables or synonyms.
>
> -Brian Hogan

Here's a diff between the ActiveRecord 1.13.2 (in RoR 1.0.0) and the
above code,
to make it easier to see what's changed.

Regards,
Blair
This topic is locked and can not be replied to.