public class CQueryPlan extends Object
This can be executed multiple times with different bind parameters.
That is, the sql including the where clause, order by clause etc must be exactly the same to share the same query plan with the only difference being bind values.
This is useful in that is common in OLTP type applications that the same query will be executed quite a lot just with different bind values. With this query plan we can bypass some of the query statement generation (for performance) and collect statistics on the number and average execution times. This is turn can be used to identify queries that could be looked at for performance tuning.
Constructor and Description |
---|
CQueryPlan(OrmQueryRequest<?> request,
SqlLimitResponse sqlRes,
SqlTree sqlTree,
boolean rawSql,
String logWhereSql)
Create a query plan based on a OrmQueryRequest.
|
CQueryPlan(OrmQueryRequest<?> request,
String sql,
SqlTree sqlTree,
boolean rawSql,
boolean rowNumberIncluded,
String logWhereSql)
Create a query plan for a raw sql query.
|
Modifier and Type | Method and Description |
---|---|
void |
bindEncryptedProperties(DataBind dataBind) |
DataReader |
createDataReader(ResultSet rset) |
void |
executionTime(long loadedBeanCount,
long timeMicros,
ObjectGraphNode objectGraphNode)
Register an execution time against this query plan;
|
Class<?> |
getBeanType() |
HashQueryPlan |
getHash() |
long |
getLastQueryTime()
Return the time this query plan was last used.
|
String |
getLogWhereSql() |
CQueryPlanStats |
getQueryStats()
Return the current query statistics.
|
CQueryPlanStats.Snapshot |
getSnapshot(boolean reset) |
String |
getSql() |
SqlTree |
getSqlTree() |
boolean |
isAutofetchTuned() |
boolean |
isRawSql() |
boolean |
isRowNumberIncluded() |
void |
resetStatistics()
Reset the query statistics.
|
String |
toString() |
public CQueryPlan(OrmQueryRequest<?> request, SqlLimitResponse sqlRes, SqlTree sqlTree, boolean rawSql, String logWhereSql)
public CQueryPlan(OrmQueryRequest<?> request, String sql, SqlTree sqlTree, boolean rawSql, boolean rowNumberIncluded, String logWhereSql)
public Class<?> getBeanType()
public DataReader createDataReader(ResultSet rset)
public void bindEncryptedProperties(DataBind dataBind) throws SQLException
SQLException
public boolean isAutofetchTuned()
public HashQueryPlan getHash()
public String getSql()
public SqlTree getSqlTree()
public boolean isRawSql()
public boolean isRowNumberIncluded()
public String getLogWhereSql()
public void resetStatistics()
public void executionTime(long loadedBeanCount, long timeMicros, ObjectGraphNode objectGraphNode)
public CQueryPlanStats.Snapshot getSnapshot(boolean reset)
public CQueryPlanStats getQueryStats()
public long getLastQueryTime()
Copyright © 2015. All Rights Reserved.