For some reason nested-Hash-style queries will always perform sub-selects. To force INNER JOINs, use String query-paths: LatestQuota. All('quota.percentage.
Gte' => threshold).
1 Thanks, that's exactly what I needed! I'm wondering why I can't find any similar syntax in the docs... – Ken Simon Jul 18 at 15:49.
I'm using DataMapper (the ruby gem) as an ORM to a mysql database. I'm writing an application that has two tables: a log of disk usage over time, and a "current usage" table containing foreign keys with the "latest" disk usage for easy reference. In my code I want to find all the entries in the LatestQuota table that correspond with a quota with a percentage higher than 95.
Whereas some_boolean_function is something that filters out the results in a manner that DataMapper can't know about, hence why I need to call ruby's select(). This is a ridiculously suboptimal query, so I think I'm doing something wrong. The quota table has millions of records in it (historical data) versus the 15k or so records in latest_quota, and selecting all quota records first and then selecting latest_quota records out of the results is exactly the wrong way to do it.
Which takes .01 seconds with my current data, instead of the 5 minutes or so it takes DataMapper to do its query. Any way to coerce it to do what I want? Do I have my relations wrong?
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.