title: Google App Engine ndb performance on repeated property
body: <p>Do I pay a penalty on query performance if I choose to query <code>repeated</code> property?  For example:</p>
  
  <pre><code>class User(ndb.Model):
      user_name = ndb.StringProperty()
      login_providers = ndb.KeyProperty(repeated=true)
  
  fbkey = ndb.Key("ProviderId", 1, "ProviderName", "FB")
  for entry in User.query(User.login_providers == fbkey):
      # Do something with entry.key
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>class User(ndb.Model)
      user_name = ndb.StringProperty()
  
  class UserProvider(ndb.Model):
      user_key = ndb.KeyProperty(kind=User)
      login_provider = ndb.KeyProperty()
  
  for entry in UserProvider.query(
      UserProvider.user_key == auserkey,
      UserProvider.login_provider == fbkey
  ):
      # Do something with entry.user_key
  </code></pre>
  
  <p>Based on the documentation from GAE, it seems that Datastore take care of indexing and the first less verbose option would be using the index.  However, I failed to find any documentation to confirm this.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The sole purpose of <code>UserProvider</code> in the second example is to create a one-to-many relationship between a user and it's login_provider.  I wanted to understand if it worth the trouble of creating a second entity instead of querying on <code>repeated</code> property.  Also, assume that all I need is the key from the <code>User</code>.</p>