title: Overhead of retrieving large entities in Google App Engine
body: <p>I have some entities in the Google App Engine data store which could be quite large (since they have blobs in them, they could have 1MB of data). Let's assume I have an entity class with the following fields (using Python for the example, but the language is irrelevant):</p>
  
  <pre><code>class File(db.Model):
      name = db.StringProperty()
      size = db.IntegerProperty()
      contents = db.BlobProperty()
  </code></pre>
  
  <p>Now when I do a query, I get back an object of type <code>File</code>, which presumably means there will be 1MB of data transfer between the database and the web server, and a 1MB Python object will be created. Are these assumptions correct?</p>
  
  <p>If so, if I wanted to display a table of files without retrieving all of their contents, I would make a query such as</p>
  
  <pre><code>SELECT * FROM File ORDER BY name ASC
  </code></pre>
  
  <p>and then display a table of the name and size of each file. Am I correct in thinking that this would actually pull the full contents of every file from the datastore into a Python object?</p>
  
  <p>Since GQL doesn't allow an SQL-like "<code>SELECT (name, size) FROM ...</code>", I assume there is no way around this, other than creating a separate entity for the actual contents of each file. </p>
  
  <pre><code>class FileContents(db.Model):
      contents = db.BlobProperty()
  
  class File(db.Model):
      name = db.StringProperty()
      size = db.IntegerProperty()
      contents = db.ReferenceProperty(FileContents)
  </code></pre>
  
  <p>Is this normal practice? Is there another solution? Note that I don't want to use the Blobstore service, as that requires billing enabled.</p>