1 21 22 package org.apache.derby.iapi.sql.compile; 23 24 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 25 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor; 26 27 import org.apache.derby.iapi.store.access.TransactionController; 28 29 import org.apache.derby.iapi.services.compiler.MethodBuilder; 30 31 import org.apache.derby.iapi.error.StandardException; 32 33 40 41 public interface JoinStrategy { 42 53 boolean feasible(Optimizable innerTable, 54 OptimizablePredicateList predList, 55 Optimizer optimizer 56 ) 57 throws StandardException; 58 59 62 boolean bulkFetchOK(); 63 64 67 boolean ignoreBulkFetch(); 68 69 73 boolean multiplyBaseCostByOuterRows(); 74 75 95 OptimizablePredicateList getBasePredicates( 96 OptimizablePredicateList predList, 97 OptimizablePredicateList basePredicates, 98 Optimizable innerTable) 99 throws StandardException; 100 101 118 double nonBasePredicateSelectivity(Optimizable innerTable, 119 OptimizablePredicateList predList) 120 throws StandardException; 121 122 135 void putBasePredicates(OptimizablePredicateList predList, 136 OptimizablePredicateList basePredicates) 137 throws StandardException; 138 154 void estimateCost(Optimizable innerTable, 155 OptimizablePredicateList predList, 156 ConglomerateDescriptor cd, 157 CostEstimate outerCost, 158 Optimizer optimizer, 159 CostEstimate costEstimate) 160 throws StandardException; 161 162 169 public int maxCapacity( int userSpecifiedCapacity, 170 int maxMemoryPerTable, 171 double perRowUsage); 172 173 174 String getName(); 175 176 177 int scanCostType(); 178 179 185 String resultSetMethodName(boolean bulkFetch); 186 187 190 String joinResultSetMethodName(); 191 192 195 String halfOuterJoinResultSetMethodName(); 196 197 224 int getScanArgs(TransactionController tc, 225 MethodBuilder mb, 226 Optimizable innerTable, 227 OptimizablePredicateList storeRestrictionList, 228 OptimizablePredicateList nonStoreRestrictionList, 229 ExpressionClassBuilderInterface acb, 230 int bulkFetch, 231 MethodBuilder resultRowAllocator, 232 int colRefItem, 233 int indexColItem, 234 int lockMode, 235 boolean tableLocked, 236 int isolationLevel, 237 int maxMemoryPerTable 238 ) 239 throws StandardException; 240 241 274 void divideUpPredicateLists( 275 Optimizable innerTable, 276 OptimizablePredicateList originalRestrictionList, 277 OptimizablePredicateList storeRestrictionList, 278 OptimizablePredicateList nonStoreRestrictionList, 279 OptimizablePredicateList requalificationRestrictionList, 280 DataDictionary dd) 281 throws StandardException; 282 283 289 public boolean isHashJoin(); 290 291 296 public boolean doesMaterialization(); 297 } 298 | Popular Tags |