google app engine - Set operations in Appengine datastore -


i assume there's no way so, if had to, how implement set operations on appengine's datastore?

for example given 2 collections of integers, how store them in datastore performance intersect , except (all items in not in b) operations?

there aren't built in set operations in datastore api. see having 2 options:

  1. for smallish sets (hundreds of items) might away doing keys-only queries both set , set b, , doing intersection in application code. precise definition of "smallish" depend on application.

  2. for largish sets (millions of items) if know ahead of time intersections you'll want, can calculate them each time insert new record. example, assume have 2 sets , b, , know you'll want query on (a intersects b). whenever insert a, check see if in b. if is, record fact somewhere (either in separate entity type, or boolean property on or b itself). of course, you'll need b's also.

with option 1, can have lots of different sets, limited how big each set is.

with option 2, can have sets millions of members, if have more few sets, trying define possible permutations of sets , operators unwieldy.


Comments

Popular posts from this blog

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -

c++ - Warning : overflow in implicit constant conversion -