use of com.cubrid.common.core.queryplan.model.PlanResult in project cubrid-manager by CUBRID.
the class QueryPlanTest method testModelPlanRoot.
public void testModelPlanRoot() {
PlanResult bean = new PlanResult();
bean.setSql("sql");
assertEquals(bean.getSql(), "sql");
bean.setRaw("raw");
assertEquals(bean.getRaw(), "raw");
bean.setPlanNode(new PlanNode());
assertEquals(bean.getPlanNode().getClass(), PlanNode.class);
bean.getPlainSql();
assertEquals(bean.toString() == null, false);
bean.setSql(null);
bean.getPlainSql();
}
use of com.cubrid.common.core.queryplan.model.PlanResult in project cubrid-manager by CUBRID.
the class PlanParserTest method testExam01.
/**
* simple plan
*
* @throws Exception
*/
public void testExam01() throws Exception {
String planString = loadPlanExmaple("plan01.txt");
PlanParser parser = new PlanParser();
boolean bool = parser.doParse(planString);
assertTrue(bool);
parser.getPlanTree(1);
PlanResult planRoot = parser.getPlanTree(0);
assertNotNull(planRoot);
PlanNode planNode = planRoot.getPlanNode();
assertEquals(planNode.getMethod(), "idx-join (inner join)");
assertEquals(planNode.getDepth(), 1);
PlanCost planCost = planNode.getCost();
assertNotNull(planCost);
assertEquals(planCost.getCard(), 40);
assertEquals(String.valueOf(planCost.getFixedCpu()), "0.0");
assertEquals(String.valueOf(planCost.getFixedDisk()), "2.0");
assertEquals(String.valueOf(planCost.getFixedTotal()), "2.0");
assertEquals(String.valueOf(planCost.getVarCpu()), "100.3");
assertEquals(String.valueOf(planCost.getVarDisk()), "275.0");
assertEquals(String.valueOf(planCost.getVarTotal()), "375.0");
assertNull(planNode.getTable());
assertNull(planNode.getIndex());
assertNull(planNode.getEdge());
assertNull(planNode.getFilter());
assertNull(planNode.getSort());
assertNull(planNode.getOrder());
PlanTerm sargs = planNode.getSargs();
assertNotNull(sargs);
assertNotNull(planNode.getChildren());
assertEquals(planNode.getChildren().size(), 2);
PlanParser parser2 = new PlanParser();
parser2.getPlanTree(0);
parser2.countPlanTree();
parser2.doParse(null);
parser2.doParse("aaa");
}
use of com.cubrid.common.core.queryplan.model.PlanResult in project cubrid-manager by CUBRID.
the class PlanParserTest method testExam03.
/**
* Partitioned table
*
* @throws Exception
*/
public void testExam03() throws Exception {
String planString = loadPlanExmaple("plan03.txt");
PlanParser parser = new PlanParser();
boolean bool = parser.doParse(planString);
assertTrue(bool);
int subPlanCount = parser.countPlanTree();
assertEquals(1, subPlanCount);
for (int i = 0; i < subPlanCount; i++) {
PlanResult planRoot = parser.getPlanTree(i);
assertNotNull(planRoot);
}
}
Aggregations