CONTEXT
The kingdom does not support property indexes of relations (objects). https://realm.io/docs/objc/latest/#indexed-properties
If you try, this will throw an error.
We have a situation where we need to request model relationships and another property.
Usually you do this by having the coverage index through (foreign_id, property), but this is not possible in Realm (yet?)
for instance
@interface Book : RLMObject
@property NSNumber<RLMInt> * page;
@end
@interface Page : RLMObject
@property Book * book;
@property NSNumber<RLMInt> * line;
@end
[Page objectsInRealm:realm where:@"book.uuid = %@ AND page.line = %@", uuid, @1];
Question
What is the best way to tune indexes so that an optimized query is optimal? Already indexed relationship? Or am I creating another property on the page called book_uuid and indexing on it?
Greetings
source
share