You might want to consider denormalizing that table by one field?

That is, create a new entity holding a foreign key relation and the
field of interest,
and create an index for that query equality.

Reads are fast, and updates are slower so creating new entities for
that data
rather than updating an increasingly large entity (the entity with a
list) might be a good approach.


On May 11, 11:08 pm, lp <lucio.picc...@gmail.com> wrote:
> hi all
> i am modelling a unowned one-to-many relationship using list properties.
>
> @Entity
> public class User{
>
> String name;
>
> Boolean loggedIn;
>
> @Basic
>     private List<Key> friends;
>
> }
>
> all is good. i can run queries like
>
> query = "Select p from PositionUser p where p.friends = :userKey and " +
>                 "AND p.loggedIn = true "
>
> However there is a limit on the number of index available per entity of
> 5000. (although i am hitting the limit at 2500 for some reason)
>
>  i have 2 problems with the current approach
>
> #1. below the 5000 limit each addition to the friend list will require a
> fetch of the entire list, then add item and then put to datastore.
> this is rather expensive in CPU.
>
> #2. How can i allow for >5000 in the onetomany?
>
> any suggestion pls
>
> -lp

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

Reply via email to