Google App Engine Objectify 查询大对象 VS 分离对象(头部和身体)
我有一个实体对象(种类)用于存储用户“广告”中的所有信息。它包括照片密钥、联系信息等。 但我只需要从所有这些中获取很少的东西来查询该对象。
将 Google App Engine (Java) 与 Objectify 结合使用。
我的问题是这样的。 拥有仅用于查询的实体对象(“头” - 带有标题、价格、城市)和另一个用于所有额外未索引详细信息的实体对象是否更强大? 或者可以将所有这些都放在一个实体对象中并将其他属性标记为未索引吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
拥有同类的详细信息就很好,这样您就不需要额外访问数据存储。正如您所指出的,最好将不需要查询或排序的任何属性标记为未索引,因为这样可以提高写入性能并减少存储空间。
您可能会发现有关掌握数据存储区的文章很有用。他们解释了有关如何构建和存储实体和索引的更多细节。
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.