سؤال

I have one entity object (kind) for storing all information from user's "advertisement". It includes keys for photographs, contact information and so on. But I need only few things from all this to query the object.

Using Google App Engine (Java) with Objectify.

My question is this. Is it more powerful to have entity object just for queries ("head" - with Title, Price, City) and another entity object to all extra unindexed details? Or is it ok to have all this in one entity object and just tag other properties as unindexed?

هل كانت مفيدة؟

المحلول

It is fine to have the details on the same kind, it will save you from needing additional trips to the datastore. As you noted, it is a good idea to mark any properties you do not need to query or order by as unindexed since it improves write performance and reduces storage space.

You might find the articles on mastering the datastore useful. They explain more of the details about how entities and indexes are built and stored.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top