data structure to implement "some of your friends also like this" feature. - Google App... - 0 views
-
A query like this will use the merge join strategy by default. If it's too slow for the merge join strategy, you could have to build a custom index for it, which would indeed be 'exploding' - each User entity would have len(friends)*len(likes) index entries.
-
Merge join queries - queries with multiple equality filters but no inequalities or sort orders - are a special case. They can be satisfied using the built in indexes and a merge join strategy, but they can also use a custom index. The production environment will use the index if it's present, and otherwise will do a merge join. Generally, a merge join works well, but there are situations in which it doesn't - in which case you may need to add an explicit index.