【发布时间】:2012-04-22 13:10:03
【问题描述】:
是否可以在播放框架实体查询中指定数据库索引提示。
我的代码如下:
public static List<Transaction> findOnInactive(Date date) {
return Transaction.find(
"date = ? and account in ( select d.acctNb from account d "
+ " where d.date = ? and (d.inactive = true or d.blocked = true)"
+ " group by d.acctNb )", date, date).fetch();
}
运行生成的查询需要 20 秒。但是使用
手动运行相同的查询select * from transaction with (INDEX(_dta_index_k1_1)) ...
只需 1 秒。无论如何我可以在我的 JPA 查询中指定索引提示?
【问题讨论】:
标签: sql-server hibernate playframework hint