Hai Phaikawl
Hai Phaikawl

Reputation: 1121

single-property GQL causes unexpected composite index

If I execute this GQL query:

GQLQuery("SELECT user FROM MyUser WHERE foo = :1", fooz)

It will cause my index.yaml to make a composite index with both the user and foo properties.

- kind: MyUser
  properties:
  - name: user
  - name: foo

And if i delete that index, when it's uploaded to App Engine and my app runs, an error appears no matching index found.

I just don't understand why GAE must create a composite index for that query??

Upvotes: 0

Views: 168

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599480

This behaviour is fully documented here:

Projection queries require all properties specified in the projection to be included in a datastore index.

Upvotes: 2

Related Questions