GAE has a built-in data type called ReferenceProperty, which is actually a db.Key as it says. It can be used to get the corresponding instance and I wonder what the complexity is?
The so called “Reference” is not like a reference in C++, which is the address, and the complexity of accessing it is O(1). And if it’s just a key in the key-value system, I wonder it may take, like O(log) or what.
Accessing a key in the datastore is done in constant time, it takes the same time to retrieve an entity by key no matter how many entities of that kind you have.