Java Doc for JoinStrategy.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » sql » compile » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.iapi.sql.compile 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.derby.iapi.sql.compile.JoinStrategy

All known Subclasses:   org.apache.derby.impl.sql.compile.BaseJoinStrategy,
JoinStrategy
public interface JoinStrategy (Code)
A JoinStrategy represents a strategy like nested loop, hash join, merge join, etc. It tells the optimizer whether the strategy is feasible in a given situation, how much the strategy costs, whether the strategy requires the data from the source result sets to be ordered, etc.




Method Summary
 booleanbulkFetchOK()
    
 voiddivideUpPredicateLists(Optimizable innerTable, OptimizablePredicateList originalRestrictionList, OptimizablePredicateList storeRestrictionList, OptimizablePredicateList nonStoreRestrictionList, OptimizablePredicateList requalificationRestrictionList, DataDictionary dd)
     Divide up the predicates into different lists for different phases of the operation.
public  booleandoesMaterialization()
    
 voidestimateCost(Optimizable innerTable, OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, CostEstimate costEstimate)
     Get the estimated cost for the join.
 booleanfeasible(Optimizable innerTable, OptimizablePredicateList predList, Optimizer optimizer)
    
 OptimizablePredicateListgetBasePredicates(OptimizablePredicateList predList, OptimizablePredicateList basePredicates, Optimizable innerTable)
     Get the base predicates for this join strategy.
 StringgetName()
    
 intgetScanArgs(TransactionController tc, MethodBuilder mb, Optimizable innerTable, OptimizablePredicateList storeRestrictionList, OptimizablePredicateList nonStoreRestrictionList, ExpressionClassBuilderInterface acb, int bulkFetch, MethodBuilder resultRowAllocator, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, int maxMemoryPerTable)
     Get the appropriate arguments to the scan for this type of join.
 StringhalfOuterJoinResultSetMethodName()
    
 booleanignoreBulkFetch()
    
public  booleanisHashJoin()
    
 StringjoinResultSetMethodName()
    
public  intmaxCapacity(int userSpecifiedCapacity, int maxMemoryPerTable, double perRowUsage)
    
 booleanmultiplyBaseCostByOuterRows()
     Returns true if the base cost of scanning the conglomerate should be multiplied by the number of outer rows.
 doublenonBasePredicateSelectivity(Optimizable innerTable, OptimizablePredicateList predList)
     Get the extra selectivity of the non-base predicates (those that were left in the predicate list by getBasePredicates() that are not applied to the scan of the base conglomerate. NOTE: For some types of join strategy, it may not remove any predicates from the original predicate list.
 voidputBasePredicates(OptimizablePredicateList predList, OptimizablePredicateList basePredicates)
     Put back and base predicates that were removed from the list by getBasePredicates (see above).
 StringresultSetMethodName(boolean bulkFetch)
    
 intscanCostType()
    



Method Detail
bulkFetchOK
boolean bulkFetchOK()(Code)
Is it OK to use bulk fetch with this join strategy?



divideUpPredicateLists
void divideUpPredicateLists(Optimizable innerTable, OptimizablePredicateList originalRestrictionList, OptimizablePredicateList storeRestrictionList, OptimizablePredicateList nonStoreRestrictionList, OptimizablePredicateList requalificationRestrictionList, DataDictionary dd) throws StandardException(Code)
Divide up the predicates into different lists for different phases of the operation. When this method is called, all of the predicates will be in restrictionList. The effect of this method is to remove all of the predicates from restrictionList except those that will be pushed down to the store as start/stop predicates or Qualifiers. The remaining predicates will be put into nonBaseTableRestrictionList. All predicate lists will be ordered as necessary for use with the conglomerate. Some operations (like hash join) materialize results, and so require requalification of rows when doing a non-covering index scan. The predicates to use for requalification are copied into baseTableRestrictionList.
Parameters:
  innerTable - The inner table of the join
Parameters:
  originalRestrictionList - Initially contains all predicates.This method removes predicates fromthis list and moves them to otherlists, as appropriate.
Parameters:
  storeRestrictionList - To be filled in with predicates tobe pushed down to store.
Parameters:
  nonStoreRestrictionList - To be filled in with predicatesthat are not pushed down to thestore.
Parameters:
  requalificationRestrictionList - Copy of predicates used tore-qualify rows, if necessary.
Parameters:
  dd - The DataDictionary
exception:
  StandardException - Thrown on error



doesMaterialization
public boolean doesMaterialization()(Code)
Is materialization built in to the join strategy? Whether or not materialization is built in to the join strategy



estimateCost
void estimateCost(Optimizable innerTable, OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, CostEstimate costEstimate) throws StandardException(Code)
Get the estimated cost for the join.
Parameters:
  predList - The predicate list for the join
Parameters:
  innerTable - The inner table to join with
Parameters:
  cd - The conglomerate descriptor (if appropriate) to getthe cost of
Parameters:
  outerCost - The estimated cost of the part of the plan outerto the inner table
Parameters:
  optimizer - The optimizer to use to help estimate the cost
Parameters:
  costEstimate - The estimated cost of doing a single scan of theinner table, to be filled in with the cost ofdoing the join.
exception:
  StandardException - Thrown on error



feasible
boolean feasible(Optimizable innerTable, OptimizablePredicateList predList, Optimizer optimizer) throws StandardException(Code)
Is this join strategy feasible under the circumstances?
Parameters:
  innerTable - The inner table of the join
Parameters:
  predList - The predicateList for the join
Parameters:
  optimizer - The optimizer to use true means the strategy is feasible, false means it isn't
exception:
  StandardException - Thrown on error



getBasePredicates
OptimizablePredicateList getBasePredicates(OptimizablePredicateList predList, OptimizablePredicateList basePredicates, Optimizable innerTable) throws StandardException(Code)
Get the base predicates for this join strategy. The base predicates are the ones that can be used while scanning the table. For some join strategies (for example, nested loop), all predicates are base predicates. For other join strategies (for example, hash join), the base predicates are those that involve comparisons with constant expressions. Also, order the base predicates according to the order in the proposed conglomerate descriptor for the inner table.
Parameters:
  predList - The predicate list to pull from.
Parameters:
  basePredicates - The list to put the base predicates in.
Parameters:
  innerTable - The inner table of the join The base predicate list. If no predicates are pulled,it may return the source predList without doing anything.
exception:
  StandardException - Thrown on error



getName
String getName()(Code)
Get the name of this join strategy



getScanArgs
int getScanArgs(TransactionController tc, MethodBuilder mb, Optimizable innerTable, OptimizablePredicateList storeRestrictionList, OptimizablePredicateList nonStoreRestrictionList, ExpressionClassBuilderInterface acb, int bulkFetch, MethodBuilder resultRowAllocator, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, int maxMemoryPerTable) throws StandardException(Code)
Get the appropriate arguments to the scan for this type of join.
Parameters:
  tc - The TransactionController
Parameters:
  mb - The method to generate the arguments in
Parameters:
  innerTable - The inner table of the join
Parameters:
  storeRestrictionList - The predicate list to be evaluated in thestore
Parameters:
  nonStoreRestrictionList - The predicate list to be evaluatedoutside of the store
Parameters:
  acb - The expression class builder for the activation classwe're building
Parameters:
  bulkFetch - The amount of bulk fetch to do
Parameters:
  resultRowAllocator - A completed method to allocate the result row
Parameters:
  colRefItem - The item number of the column reference bit map
Parameters:
  lockMode - The lock mode to use when scanning the table(see TransactionController).
Parameters:
  tableLocked - Whether or not the table is marked (in sys.systables)as always using table locking
Parameters:
  isolationLevel - Isolation level specified (or not) for scans
Parameters:
  maxMemoryPerTable - Max memory per table Count of the expressions pushed to use as the parameters to theresult set for the inner table
exception:
  StandardException - Thrown on error



halfOuterJoinResultSetMethodName
String halfOuterJoinResultSetMethodName()(Code)
Get the name of the join result set method for the half outerjoin



ignoreBulkFetch
boolean ignoreBulkFetch()(Code)
Should we just ignore bulk fetch with this join strategy?



isHashJoin
public boolean isHashJoin()(Code)
Is this a form of hash join? Whether or not this strategy is a formof hash join.



joinResultSetMethodName
String joinResultSetMethodName()(Code)
Get the name of the join result set method for the join



maxCapacity
public int maxCapacity(int userSpecifiedCapacity, int maxMemoryPerTable, double perRowUsage)(Code)

Parameters:
  userSpecifiedCapacity -
Parameters:
  maxMemoryPerTable - maximum number of bytes per table
Parameters:
  perRowUsage - number of bytes per row The maximum number of rows that can be handled by this join strategy



multiplyBaseCostByOuterRows
boolean multiplyBaseCostByOuterRows()(Code)
Returns true if the base cost of scanning the conglomerate should be multiplied by the number of outer rows.



nonBasePredicateSelectivity
double nonBasePredicateSelectivity(Optimizable innerTable, OptimizablePredicateList predList) throws StandardException(Code)
Get the extra selectivity of the non-base predicates (those that were left in the predicate list by getBasePredicates() that are not applied to the scan of the base conglomerate. NOTE: For some types of join strategy, it may not remove any predicates from the original predicate list. The join strategy is expected to know when it does this, and to return 1.0 as the extra selectivity in these cases.
Parameters:
  innerTable - The inner table of the join.
Parameters:
  predList - The original predicate list that was passed togetBasePredicates(), from which some base predicatesmay have been pulled. The extra selectivity due to non-base predicates



putBasePredicates
void putBasePredicates(OptimizablePredicateList predList, OptimizablePredicateList basePredicates) throws StandardException(Code)
Put back and base predicates that were removed from the list by getBasePredicates (see above). NOTE: Those join strategies that treat all predicates as base predicates may treat the get and put methods as no-ops.
Parameters:
  predList - The list of predicates to put the base predicatesback in.
Parameters:
  basePredicates - The base predicates to put back in the list.
exception:
  StandardException - Thrown on error



resultSetMethodName
String resultSetMethodName(boolean bulkFetch)(Code)
Get the name of the result set method for base table scans
Parameters:
  bulkFetch - True means bulk fetch is being done on the innertable



scanCostType
int scanCostType()(Code)
Get the costing type, for use with StoreCostController.getScanCost



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.