简体   繁体   English

如何在Appengine数据存储区中应用依赖的文件过滤器?

[英]How to apply dependent fileds filters in appengine datastore?

Representation of my datastore: 我的数据存储的表示形式:

key|first|second|
-----------------
xys|55   |34
-----------------
kow|32   |67

If I have to write a sql query then it should be like this: 如果我必须编写一个sql查询,则应该是这样的:

select * from x where first > second + 20;

How could I write it in appengine datastore ? 如何在appengine datastore编写它? Is there any way to achieve it by Query.FilterPredicate ? 有什么办法可以通过Query.FilterPredicate实现它吗?

Based on the fact that all appengine queries must be efficient. 基于所有appengine查询必须高效的事实。 I cant see how to avoid a full scan using datastore indexes of those two properties which is not efficient. 我看不到如何避免使用效率不高的这两个属性的数据存储区索引进行全面扫描。
the solution is to also store the difference (first-second) then you can filter on the difference > 20. 解决方案是还存储差异(第一秒),然后可以过滤差异> 20。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM