Search in sources :

Example 1 with PlanParser

use of com.cubrid.common.core.queryplan.PlanParser in project cubrid-manager by CUBRID.

the class PlanParserTest method testExam07.

/**
	 * Partitioned table
	 * 
	 * @throws Exception
	 */
public void testExam07() throws Exception {
    String planString = loadPlanExmaple("plan07.txt");
    PlanParser parser = new PlanParser();
    boolean bool = parser.doParse(planString);
    assertFalse(bool);
}
Also used : PlanParser(com.cubrid.common.core.queryplan.PlanParser)

Example 2 with PlanParser

use of com.cubrid.common.core.queryplan.PlanParser in project cubrid-manager by CUBRID.

the class PlanParserTest method testExam02.

/**
	 * complicated plan
	 * 
	 * @throws Exception
	 */
public void testExam02() throws Exception {
    String planString = loadPlanExmaple("plan02.txt");
    PlanParser parser = new PlanParser();
    boolean bool = parser.doParse(planString);
    assertTrue(bool);
    int subPlanCount = parser.countPlanTree();
    assertEquals(10, subPlanCount);
    for (int i = 0; i < subPlanCount; i++) {
        PlanResult planRoot = parser.getPlanTree(i);
        assertNotNull(planRoot);
    }
}
Also used : PlanResult(com.cubrid.common.core.queryplan.model.PlanResult) PlanParser(com.cubrid.common.core.queryplan.PlanParser)

Example 3 with PlanParser

use of com.cubrid.common.core.queryplan.PlanParser in project cubrid-manager by CUBRID.

the class PlanParserTest method testExam04.

/**
	 * Partitioned table
	 * 
	 * @throws Exception
	 */
public void testExam04() throws Exception {
    String planString = loadPlanExmaple("plan04.txt");
    PlanParser parser = new PlanParser();
    boolean bool = parser.doParse(planString);
    assertFalse(bool);
}
Also used : PlanParser(com.cubrid.common.core.queryplan.PlanParser)

Example 4 with PlanParser

use of com.cubrid.common.core.queryplan.PlanParser 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");
}
Also used : PlanResult(com.cubrid.common.core.queryplan.model.PlanResult) PlanNode(com.cubrid.common.core.queryplan.model.PlanNode) PlanCost(com.cubrid.common.core.queryplan.model.PlanCost) PlanParser(com.cubrid.common.core.queryplan.PlanParser) PlanTerm(com.cubrid.common.core.queryplan.model.PlanTerm)

Example 5 with PlanParser

use of com.cubrid.common.core.queryplan.PlanParser in project cubrid-manager by CUBRID.

the class PlanParserTest method testExam06.

/**
	 * Partitioned table
	 * 
	 * @throws Exception
	 */
public void testExam06() throws Exception {
    String planString = loadPlanExmaple("plan06.txt");
    PlanParser parser = new PlanParser();
    boolean bool = parser.doParse(planString);
    assertFalse(bool);
}
Also used : PlanParser(com.cubrid.common.core.queryplan.PlanParser)

Aggregations

PlanParser (com.cubrid.common.core.queryplan.PlanParser)7 PlanResult (com.cubrid.common.core.queryplan.model.PlanResult)3 PlanCost (com.cubrid.common.core.queryplan.model.PlanCost)1 PlanNode (com.cubrid.common.core.queryplan.model.PlanNode)1 PlanTerm (com.cubrid.common.core.queryplan.model.PlanTerm)1