Now the evil thing is, that even thou’ :include is specified, it does
nothing. New AR eager loading resorts to doing n+1 sql queries in
FowSsEntry.for(1,1).each { |fse| fse.solar_system }
How do I force it into joining my table, without impacting my SQL
performance?
Now the evil thing is, that even thou’ :include is specified, it does
nothing. New AR eager loading resorts to doing n+1 sql queries in
FowSsEntry.for(1,1).each { |fse| fse.solar_system }
How do I force it into joining my table, without impacting my SQL
performance?
Is the issue the fact that :include does not always trigger a join
based strategy ? What are the actual sql queries you see?
Now the evil thing is, that even thou’ :include is specified, it does
nothing. New AR eager loading resorts to doing n+1 sql queries in
FowSsEntry.for(1,1).each { |fse| fse.solar_system }
How do I force it into joining my table, without impacting my SQL
performance?
Is the issue the fact that :include does not always trigger a join
based strategy ? What are the actual sql queries you see?
Yes.
I see this:
[2009-11-03 00:35:26|main|debug] FowSsEntry Load (0.0ms) SELECT * FROM fow_ss_entries WHERE (fow_ss_entries.galaxy_id = 1 AND fow_ss_entries.player_id = 1)
[2009-11-03 00:35:26|main|debug] SolarSystem Load (0.0ms) SELECT * FROM solar_systems WHERE (solar_systems.id = 57)
[2009-11-03 00:35:26|main|debug] SolarSystem Load (0.0ms) SELECT * FROM solar_systems WHERE (solar_systems.id = 157)
[2009-11-03 00:35:26|main|debug] SolarSystem Load (0.0ms) SELECT * FROM solar_systems WHERE (solar_systems.id = 313)
[2009-11-03 00:35:26|main|debug] SolarSystem Load (0.0ms) SELECT * FROM solar_systems WHERE (solar_systems.id = 314)