#1202 - Automatically remove old query plans from Ebean's internal query plan cache

This commit is contained in:
Rob Bygrave
2017-11-06 22:59:42 +13:00
parent fcf730ec39
commit 2b94487573
7 changed files with 72 additions and 4 deletions
@@ -16,6 +16,8 @@ import java.sql.SQLException;
*/
class CQueryRowCount {
private final CQueryPlan queryPlan;
/**
* The overall find request wrapper object.
*/
@@ -54,7 +56,8 @@ class CQueryRowCount {
/**
* Create the Sql select based on the request.
*/
CQueryRowCount(OrmQueryRequest<?> request, CQueryPredicates predicates, String sql) {
CQueryRowCount(CQueryPlan queryPlan, OrmQueryRequest<?> request, CQueryPredicates predicates, String sql) {
this.queryPlan = queryPlan;
this.request = request;
this.query = request.getQuery();
this.sql = sql;
@@ -116,6 +119,7 @@ class CQueryRowCount {
rowCount = rset.getInt(1);
executionTimeMicros = (System.nanoTime() - startNano) / 1000L;
queryPlan.executionTime(rowCount, executionTimeMicros, query.getParentNode());
request.slowQueryCheck(executionTimeMicros, rowCount);
return rowCount;