1 package com.daffodilwoods.daffodildb.server.sql99.dql.plan.table; 2 3 import com.daffodilwoods.daffodildb.client.*; 4 import com.daffodilwoods.daffodildb.server.serversystem.*; 5 import com.daffodilwoods.daffodildb.server.sql99.dql.common.*; 6 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.*; 7 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.*; 8 import com.daffodilwoods.database.resource.*; 9 10 22 23 public class TwoTableJoinPlan extends JoinPlanAbstract implements TableExpressionConstants, _TablePlan { 24 25 public TwoTableJoinPlan(_TablePlan tablePlanLeft0, _TablePlan tablePlanRight0, booleanvalueexpression joinCondition0) throws DException { 26 tablePlanLeft = tablePlanLeft0; 27 tablePlanRight = tablePlanRight0; 28 joinCondition = joinCondition0; 29 childPlans = new _TablePlan[] {tablePlanLeft0, tablePlanRight0}; 30 initializeTableDetails(); 31 } 32 33 41 42 public long getRowCount(_ServerSession serverSession) throws DException { 43 return Math.min(tablePlanLeft.getRowCount(serverSession), tablePlanRight.getRowCount(serverSession)); 44 } 45 46 51 52 public int getType() throws DException { 53 return TWOTABLEJOINPLAN; 54 } 55 56 public String toString() { 57 return super.toString("TWOTABLEJOINPLAN"); 58 } 59 60 public String getVerifier() throws DException { 61 return super.getVerifier("TWO_TABLE_JOIN_PLAN"); 62 } 63 64 69 70 public _QueryPlan getQueryPlan() throws DException { 71 _QueryPlan[] cplans = new _QueryPlan[2]; 72 cplans[0] = tablePlanLeft.getQueryPlan(); 73 cplans[1] = tablePlanRight.getQueryPlan(); 74 String cond = joinCondition == null ? null : ("" + joinCondition); 75 return new QueryPlan("TwoTableJoinPLAN", cplans, cond, null); 76 } 77 78 83 84 public _TablePlan[] getChildTablePlans() throws DException { 85 return new _TablePlan[] {this}; 86 } 87 88 } 89 | Popular Tags |