1 21 22 package org.apache.derby.iapi.sql.compile; 23 24 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor; 25 import org.apache.derby.iapi.sql.dictionary.TableDescriptor; 26 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 27 28 import org.apache.derby.iapi.error.StandardException; 29 30 import org.apache.derby.iapi.util.JBitSet; 31 32 import java.util.Properties ; 33 34 37 38 public interface Optimizable { 39 40 58 boolean nextAccessPath(Optimizer optimizer, 59 OptimizablePredicateList predList, 60 RowOrdering rowOrdering) 61 throws StandardException; 62 63 77 CostEstimate optimizeIt( 78 Optimizer optimizer, 79 OptimizablePredicateList predList, 80 CostEstimate outerCost, 81 RowOrdering rowOrdering) 82 throws StandardException; 83 84 87 AccessPath getCurrentAccessPath(); 88 89 92 AccessPath getBestAccessPath(); 93 94 97 AccessPath getBestSortAvoidancePath(); 98 99 102 AccessPath getTrulyTheBestAccessPath(); 103 104 108 void rememberSortAvoidancePath(); 109 110 114 boolean considerSortAvoidancePath(); 115 116 120 void rememberJoinStrategyAsBest(AccessPath ap); 121 122 127 TableDescriptor getTableDescriptor(); 128 129 134 JBitSet getReferencedTableMap(); 135 136 145 boolean pushOptPredicate(OptimizablePredicate optimizablePredicate) 146 throws StandardException; 147 148 157 void pullOptPredicates(OptimizablePredicateList optimizablePredicates) 158 throws StandardException; 159 160 171 Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException; 172 173 183 public boolean isCoveringIndex(ConglomerateDescriptor cd) throws StandardException; 184 185 190 public Properties getProperties(); 191 192 197 public void setProperties(Properties tableProperties); 198 199 206 public void verifyProperties(DataDictionary dDictionary) throws StandardException; 207 208 214 public String getName() throws StandardException; 215 216 221 public String getBaseTableName(); 222 223 232 public int convertAbsoluteToRelativeColumnPosition(int absolutePosition); 233 234 264 public void updateBestPlanMap(short action, 265 Object planKey) throws StandardException; 266 267 277 public void rememberAsBest(int planType, Optimizer optimizer) 278 throws StandardException; 279 280 286 public void startOptimizing(Optimizer optimizer, RowOrdering rowOrdering); 287 288 308 CostEstimate estimateCost(OptimizablePredicateList predList, 309 ConglomerateDescriptor cd, 310 CostEstimate outerCost, 311 Optimizer optimizer, 312 RowOrdering rowOrdering) 313 throws StandardException; 314 315 316 boolean isBaseTable(); 317 318 322 boolean isMaterializable() throws StandardException; 323 324 325 boolean supportsMultipleInstantiations(); 326 327 328 int getResultSetNumber(); 329 330 331 int getTableNumber(); 332 333 334 boolean hasTableNumber(); 335 336 337 public boolean forUpdate(); 338 339 340 public int initialCapacity(); 341 342 343 public float loadFactor(); 344 345 346 public int[] hashKeyColumns(); 347 348 349 public void setHashKeyColumns(int[] columnNumbers); 350 351 363 public boolean feasibleJoinStrategy(OptimizablePredicateList predList, 364 Optimizer optimizer) 365 throws StandardException; 366 367 374 public boolean memoryUsageOK( double rowCount, int maxMemoryPerTable) 375 throws StandardException; 376 377 385 public int maxCapacity( JoinStrategy joinStrategy, int maxMemoryPerTable) throws StandardException; 386 387 395 public boolean legalJoinOrder(JBitSet assignedTableMap); 396 397 406 public DataDictionary getDataDictionary() throws StandardException; 407 408 413 public boolean isTargetTable(); 414 415 420 public int getNumColumnsReturned(); 421 422 429 public boolean isOneRowScan() throws StandardException; 430 431 436 public void initAccessPaths(Optimizer optimizer); 437 438 451 public double uniqueJoin(OptimizablePredicateList predList) 452 throws StandardException; 453 } 454 | Popular Tags |