rails large amount of data in single insert activerecord gave out

Posted by Nik on Stack Overflow See other posts from Stack Overflow or by Nik
Published on 2010-05-17T05:41:43Z Indexed on 2010/05/17 5:50 UTC
Read the original article Hit count: 201

Filed under:
|
|

So I have I think around 36,000 just to be safe, a number I wouldn't think was too large for a modern sql database like mysql. Each record has just two attributes.

So I do: so I collected them into one single insert statement

sql = "INSERT INTO tasks (attrib_a, attrib_b) VALUES (c1,d1),(c2,d2),(c3,d3)...(c36000,d36000);"

ActiveRecord::Base.connection.execute sql

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract_adapter.rb:219:in `log'
from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:323:in `execute_without_analyzer
from c:/r/projects/vendor/plugins/rails-footnotes/lib/rails-footnotes/notes/queries_note.rb:130:in `execute'
from C:/Ruby/lib/ruby/1.8/benchmark.rb:308:in `realtime'
from c:/r/projects/vendor/plugins/rails-footnotes/lib/rails-footnotes/notes/queries_note.rb:130:in `execute'
from (irb):53
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/time_or_datetime.rb:242

I don't know if the above info is enough, please do ask for anything that I didn't provide here. So any idea what this is about?

THANK YOU!!!!

© Stack Overflow or respective owner

Related posts about rails

Related posts about mysql