本文整理匯總了Java中org.voltdb.planner.TrivialCostModel類的典型用法代碼示例。如果您正苦於以下問題:Java TrivialCostModel類的具體用法?Java TrivialCostModel怎麽用?Java TrivialCostModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TrivialCostModel類屬於org.voltdb.planner包,在下文中一共展示了TrivialCostModel類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: planSqlCore
import org.voltdb.planner.TrivialCostModel; //導入依賴的package包/類
/**
* Stripped down compile that is ONLY used to plan default procedures.
*/
public synchronized CompiledPlan planSqlCore(String sql, StatementPartitioning partitioning) {
TrivialCostModel costModel = new TrivialCostModel();
DatabaseEstimates estimates = new DatabaseEstimates();
QueryPlanner planner = new QueryPlanner(
sql, "PlannerTool", "PlannerToolProc", m_cluster, m_database,
partitioning, m_hsql, estimates, true,
AD_HOC_JOINED_TABLE_LIMIT, costModel, null, null, DeterminismMode.FASTER);
CompiledPlan plan = null;
try {
// do the expensive full planning.
planner.parse();
plan = planner.plan();
assert(plan != null);
}
catch (Exception e) {
throw new RuntimeException("Error compiling query: " + e.toString(), e);
}
if (plan == null) {
throw new RuntimeException("Null plan received in PlannerTool.planSql");
}
return plan;
}