Stack level too deep on sequel eager load

jmagoon

I'm attempting to eagerly load a relatively large table using the Sequel ORM to test the amount of results I get based on using different key conditions:

a = Eqmifsequel.eager(:paauditsequels).all

The relationship looks like this:

one_to_many :paauditsequels, :primary_key => [:serial_number,:customer_number], :key => [:serial_number,:cust]

The tables are the following sizes

eqmifsequel : 69357 records
paauditsequel : 8648976 records

When I run the line of code at the top, I get a 'stack level too deep' error. I've tried upping my ulimit stack size (up to 1GB), but that doesn't seem to change anything.

I'm guessing I'm doing something bad, but I don't have the knowledge (math, cs, hardware) to know what or why.

Can anyone give me some suggestions? Is there a way I can calculate how much stack space I'm about to use when I try to join and return two large tables? Does this have to do with how Sequel is creating the join? If it were to succeed, would I end up crashing my system?

TomDunning

Haha, yeah. When you call .all it will return the entire data set in a single block.

Whatever you were planning on doing with the data that's the wrong approach. If you're trying to iterate through everything use .find_each like so:

Eqmifsequel.joins(:paauditsequels).find_each do |i|
  # something
end

If you're only interested in the number of results:

Eqmifsequel.joins(:paauditsequels).count

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Stack level too deep

From Dev

Stack level too deep

From Dev

Ruby: Getting Stack level too deep on YAML.load of hash

From Dev

SystemStackError - Stack Level Too Deep

From Dev

Stack level too deep with Devise

From Dev

Rails 3.2.21 instrumenter stack level too deep

From Dev

alias_method: stack level too deep

From Dev

Stack level too deep and before_save

From Dev

Ruby, stack level too deep (SystemStackError)

From Dev

Stack level too deep because recursion

From Dev

rspec + factorygirl : stack level too deep

From Dev

Stack level too deep on user.save

From Dev

Stack Level Too Deep, Modules and Classes

From Dev

SystemStackError - stack level too deep with a User Search

From Dev

Rails 4 Stack level too deep Error

From Dev

Ruby : stack level too deep (SystemStackError)

From Dev

Each loop, stack level too deep (SystemStackError)

From Dev

SystemStackError (stack level too deep) in Model

From Dev

Ruby routes - stack level too deep

From Dev

Stack level too deep in Ruby in subscription model

From Dev

Rails 5.1.6 - Stack level too deep

From Dev

Merge Sort confusion, stack level too deep?

From Dev

Stack Level Too Deep error - produced with strong parameters I think

From Dev

Stack level too deep when using carrierwave versions

From Dev

Stack Level Too Deep Error on Calling Yield in Ruby

From Dev

Merging Ranges using Sets - Error - Stack level too deep (SystemStackError)

From Dev

stack level too deep (SystemStackError) when loading hash via require

From Dev

Rails Console: User will not save - Stack level too deep

From Dev

Find cause of 'Stack level too deep' in Carrierwave when destroying files

Related Related

HotTag

Archive