title: SQLAlchemy: Test if a relationship exists without actually loading it
body: <p>I'm not sure if this is even possible, but I have a hierarchy type structure in SQLite using SQLAlchemy. 
  In my hierarchy I want to indicate to the user that a parent has children, without needing to load all the children.
  I know SQLAlchemy uses lazy loading, but the moment I access the relationship attribute, the entire list is loaded. Since a parent can have thousands of children, this is quite a performance overhead for just testing <code>children != None</code>.</p>
  
  <p>Currently the relationship is defined as follows:</p>
  
  <pre><code>children = relationship('child',
                          cascade='all',
                          backref=backref('parent'),
                          )
  </code></pre>
  
  <p>And I currently test for children using:</p>
  
  <pre><code>qry = session.query(parenttable).all()
  
  for parent in qry:
      if parent.children != None:
          childrenindication = [{'Name': '...'}]
      else:
          childrenindication = []
  
      hierarchylist.append({
                  'Name': parent.name,
                  'Children': childrenindication
                  })
  </code></pre>
  
  <p>It would be great if there was a more performance friendly way to do this.</p>