title: Understanding Grails' GORM nested fields and performance
body: <p>I'm trying to understand the implications of seemingly innocent nested field access of domain objects in Grails. For example, if I have something like:</p>
  
  <pre><code>def blah = SomeDomain.findAllBySomething("a")
  </code></pre>
  
  <p>And then access nested fields of other domain objects, like:</p>
  
  <pre><code>// do stuff with blah, then grab this
  def dataOfInterest = blah.findAll { it.something.that.is.nested.deep &gt; 2 }
  </code></pre>
  
  <p>Is GORM smart at all about getting at 'deep'? Does it have to execute SQL statements and populate each object along the way? Am I correct in thinking that this is going to be terribly inefficient, and if so, with performance in mind, what might you suggest?</p>