GAE data store indexing

27 views
Skip to first unread message

Bruce Aloe

unread,
Jun 30, 2011, 9:34:14 AM6/30/11
to Google App Engine
Hello,

I have read the online documentation about GAE data store index, but
don't get it well.

Suppose i have a kind (table) Employee, with columns (attributes)
(EmployeeId, Age, Position, Salary, StartingDate), and 10000 employees
are stored in the data store.

Does it mean all the attributes (EmployeeId, Age, Position, Salary,
StartingDate) get indexed automatically when the Employee kind is
created?

What is your opinion?

Thanks!

Bruce

Pascal Voitot Dev

unread,
Jun 30, 2011, 9:37:25 AM6/30/11
to google-a...@googlegroups.com
From what I understand, I would answer no it shouldn't be indexed automatically until you add a specific index in the datastore-indexes.xml

Pascal


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.


Jay Young

unread,
Jun 30, 2011, 10:52:17 AM6/30/11
to google-a...@googlegroups.com
If you do not explicitly mark each property as unindexed, they will all be added to the built-in single property indexes.

Geoffrey Spear

unread,
Jun 30, 2011, 1:51:26 PM6/30/11
to Google App Engine
"Employee kind is created" is kind of meaningless. The datastore is
schemaless, and only cares about entities you actually put(). Assuming
you put() all of the entities with those attributes, yes, 2 indexes
(one in each direction) will be created for each property for each
entity. There are no "columns"; you can happily create Employee
entities with any of those properties or completely different
properties (although this isn't necessarily a good idea). The
datastore layer doesn't know or care what the kind definition says, it
only care what properties actual saved entities have.

Bruce Aloe

unread,
Jun 30, 2011, 3:57:36 PM6/30/11
to Google App Engine
Hello Geoffrey, you mentioned "2 indexes (one in each direction) will
be created for each property for each entity. "

What are the 2 indexes and why? what are the 2 indexes names?

Bruce

On Jun 30, 7:51 pm, Geoffrey Spear <geoffsp...@gmail.com> wrote:

Geoffrey Spear

unread,
Jul 1, 2011, 8:53:41 AM7/1/11
to Google App Engine


On Jun 30, 3:57 pm, Bruce Aloe <brucea...@gmail.com> wrote:
> Hello Geoffrey, you mentioned "2 indexes (one in each direction) will
> be created for each property for each entity. "
>
> What are the 2 indexes and why? what are the 2 indexes names?

You cannot do a query in App Engine without using an index; there are
no full table scans. To query on a property, it needs to be indexed,
and to allow for ordering in both directions, there need to be both
forward and backward indexes.

I'm not sure what the index names are; it's an irrelevant
implementation detail. I don't believe that even digging in the low-
level datastore API allows you access to the indexes by name.
Reply all
Reply to author
Forward
0 new messages