Very low limit on #values in index for an entity?

14 views
Skip to first unread message

jbdhl

unread,
Apr 10, 2010, 6:56:43 AM4/10/10
to Google App Engine
In the section "Quotas and Limits" in
http://code.google.com/appengine/docs/java/datastore/overview.html
there is a table stating
»maximum number of values in an index for an entity (1): 1,000«
where (1) is the following footnote:
»An entity uses one value in an index for every column × every row
that refers to the entity, in all indexes. The number of indexes
values for an entity can grow large if an indexed property has
multiple values, requiring multiple rows with repeated values in the
table.«

Can anyone explain what that means?!

It seems that the number of entities referring to a specific entity,
X, will be limited by this limit which means, that a parent entity can
only have a quite limited number of child entities. Is that right?

Jaroslav Záruba

unread,
Apr 11, 2010, 9:48:48 PM4/11/10
to google-a...@googlegroups.com
This is one of my concerns about DataStore since I read the docs for the first time. therefore I'm also wondering what the answer here is.


--
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.


Nick Johnson (Google)

unread,
Apr 12, 2010, 6:30:02 AM4/12/10
to google-a...@googlegroups.com
Hi,

The limit is actually 5000, and refers to the index entries per entity. Index entries depend only on the contents of the entity, not on entities that reference it. For example, an entity with 3 non-list indexed properties 'foo', 'bar', 'baz' would have 3 index entries. If 'foo' was a 5 element list, it would have a total of 8 index entries. If bar was also a 5 element list, it would have 11 index entries - and so forth.

-Nick Johnson

--
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.




--
Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047

jbdhl

unread,
Apr 14, 2010, 4:15:29 PM4/14/10
to Google App Engine
@Nick:
That makes sense. However, I think the footnote text should be
modified - it is really hard to tell the meaning of it. For instance,
It uses a multiplication ("x") between two "for every..."-phrases.
That doesn't "type check", but seems to be an attempt to denote the
*cardinality* of the Cartesian product of the two sets. Also, what
does "...in all indexes" refer to when the limit is *per* *index*? You
should rather write something more formally precise like:

»Let E be an arbitrary entity, let A(E) denote the number of
columns (including individual list items for list-type columns) for E,
and let B(E) denote the number of index-rows in a single index
referring to E. Then the number of values for E in that index is
A(E)*B(E).«

And here, the requirement apparently is, that in each index and for
each entity, E, we must have A(E)*B(E) < 5000.

Reply all
Reply to author
Forward
0 new messages