Java Doc for OptimizablePredicateList.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.OptimizablePredicateList

All known Subclasses:   org.apache.derby.impl.sql.compile.PredicateList,
OptimizablePredicateList
public interface OptimizablePredicateList (Code)
OptimizablePredicateList provides services for optimizing a table in a query. RESOLVE - the methods for this interface need to get defined.




Method Summary
 voidaddOptPredicate(OptimizablePredicate optPredicate)
     Add the given OptimizablePredicate to the end of this list.
 voidclassify(Optimizable optTable, ConglomerateDescriptor cd)
     Classify the predicates in this list according to the given table and conglomerate.
public  voidcopyPredicatesToOtherList(OptimizablePredicateList otherList)
     Non-destructive copy of all of the predicates from this list to the other list.
 voidgenerateQualifiers(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable, boolean absolute)
     Generate the qualifiers for a scan.
 voidgenerateStartKey(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable)
     Generate the start key for a heap or index scan.
 voidgenerateStopKey(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable)
     Generate the stop key for a heap or index scan.
public  OptimizablePredicategetOptPredicate(int n)
     Return the nth OptimizablePredicate in the list.
Parameters:
  n - "index" (0 based) into the list.
 booleanhasOptimizableEqualityPredicate(Optimizable optTable, int columnNumber, boolean isNullOkay)
    
 booleanhasOptimizableEquijoin(Optimizable optTable, int columnNumber)
     Is there an optimizable equijoin on the specified column?
Parameters:
  optTable - The optimizable the column comes from.
Parameters:
  columnNumber - The column number within the base table.
public  booleanisRedundantPredicate(int predNum)
     Return whether or not the specified entry in the list is a redundant predicate.
public  voidmarkAllPredicatesQualifiers()
     Mark all of the predicates as Qualifiers and set the numberOfQualifiers to reflect this.
 voidpushUsefulPredicates(Optimizable optTable)
     Determine which predicates in this list are useful for limiting the scan on the given table using its best conglomerate.
 voidputOptimizableEqualityPredicateFirst(Optimizable optTable, int columnNumber)
     Find the optimizable equality predicate on the specified column and make it the first predicate in this list.
 voidremoveOptPredicate(int predCtr)
     Remove the OptimizablePredicate at the specified index (0-based) from the list.
public  booleansameStartStopPosition()
     Can we use the same key for both the start and stop key.
public  doubleselectivity(Optimizable optTable)
     calculate the selectivity for a set of predicates.
public  voidsetPredicatesAndProperties(OptimizablePredicateList otherList)
     Sets the given list to have the same elements as this one, and the same properties as this one (number of qualifiers and start and stop predicates.
public  intsize()
     Return the number of OptimizablePredicates in the list.
 intstartOperator(Optimizable optTable)
     Get the start operator for the given Optimizable for a heap or index scan.
 intstopOperator(Optimizable optTable)
     Get the stop operator for the given Optimizable for a heap or index scan.
public  voidtransferAllPredicates(OptimizablePredicateList otherList)
     Transfer all the predicates from this list to the given list.
public  voidtransferPredicates(OptimizablePredicateList otherList, JBitSet referencedTableMap, Optimizable table)
     Transfer the predicates whose referenced set is contained by the specified referencedTableMap from this list to the other list.
 booleanuseful(Optimizable optTable, ConglomerateDescriptor cd)
     Return true if this predicate list is useful for limiting the scan on the given table using the given conglomerate.



Method Detail
addOptPredicate
void addOptPredicate(OptimizablePredicate optPredicate)(Code)
Add the given OptimizablePredicate to the end of this list.
Parameters:
  optPredicate - The predicate to add



classify
void classify(Optimizable optTable, ConglomerateDescriptor cd) throws StandardException(Code)
Classify the predicates in this list according to the given table and conglomerate. Each predicate can be a start key, stop key, and/or qualifier, or it can be none of the above. This method also orders the predicates to match the order of the columns in a keyed conglomerate. No ordering is done for heaps.
Parameters:
  optTable - The Optimizable table for which to classifythe predicates in this list.
Parameters:
  cd - The ConglomerateDescriptor for which to classifythe predicates in this list.
exception:
  StandardException - Thrown on error



copyPredicatesToOtherList
public void copyPredicatesToOtherList(OptimizablePredicateList otherList) throws StandardException(Code)
Non-destructive copy of all of the predicates from this list to the other list. This is useful when splitting out a set of predicates from a larger set, like when generating a HashScanResultSet.
Parameters:
  otherList - The predicateList to xfer to
exception:
  StandardException - Thrown on error



generateQualifiers
void generateQualifiers(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable, boolean absolute) throws StandardException(Code)
Generate the qualifiers for a scan. This method generates an array of Qualifiers, and fills them in with calls to the factory method for generating Qualifiers in the constructor for the activation. It stores the array of Qualifiers in a field in the activation, and returns a reference to that field. If there are no qualifiers, it initializes the array of Qualifiers to null.
Parameters:
  acb - The ExpressionClassBuilderInterface for the class we are building
Parameters:
  mb - The method the generated code is going into
Parameters:
  optTable - The Optimizable table the Qualifiers are on
Parameters:
  absolute - Generate absolute column positions if true,else relative column positions (within the underlyingrow)
exception:
  StandardException - Thrown on error



generateStartKey
void generateStartKey(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable) throws StandardException(Code)
Generate the start key for a heap or index scan.
Parameters:
  acb - The ExpressionClassBuilderInterface for the class we're building
Parameters:
  mb - The method the generated code is to go into
Parameters:
  optTable - The Optimizable table the start key is for
exception:
  StandardException - Thrown on error



generateStopKey
void generateStopKey(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable) throws StandardException(Code)
Generate the stop key for a heap or index scan.
Parameters:
  acb - The ExpressionClassBuilderInterface for the class we're building
Parameters:
  mb - the method the generated code is to go into
Parameters:
  optTable - The Optimizable table the stop key is for
exception:
  StandardException - Thrown on error



getOptPredicate
public OptimizablePredicate getOptPredicate(int n)(Code)
Return the nth OptimizablePredicate in the list.
Parameters:
  n - "index" (0 based) into the list. OptimizablePredicate The nth OptimizablePredicate in the list.



hasOptimizableEqualityPredicate
boolean hasOptimizableEqualityPredicate(Optimizable optTable, int columnNumber, boolean isNullOkay) throws StandardException(Code)
Is there an optimizable equality predicate on the specified column?
Parameters:
  optTable - The optimizable the column comes from.
Parameters:
  columnNumber - The column number within the base table.
Parameters:
  isNullOkay - boolean, whether or not the IS NULL operatorsatisfies the search Whether or not there is an optimizable equality predicate on the specified column.
exception:
  StandardException - Thrown on error



hasOptimizableEquijoin
boolean hasOptimizableEquijoin(Optimizable optTable, int columnNumber) throws StandardException(Code)
Is there an optimizable equijoin on the specified column?
Parameters:
  optTable - The optimizable the column comes from.
Parameters:
  columnNumber - The column number within the base table. Whether or not there is an optimizable equijoin on the specified column.
exception:
  StandardException - Thrown on error



isRedundantPredicate
public boolean isRedundantPredicate(int predNum)(Code)
Return whether or not the specified entry in the list is a redundant predicate. This is useful for selectivity calculations because we do not want redundant predicates included in the selectivity calculation.
Parameters:
  predNum - The entry in the list Whether or not the specified entry in the list is a redundant predicate.



markAllPredicatesQualifiers
public void markAllPredicatesQualifiers()(Code)
Mark all of the predicates as Qualifiers and set the numberOfQualifiers to reflect this. This is useful for hash joins where all of the predicates in the list to be evaluated during the probe into the hash table on a next are qualifiers.



pushUsefulPredicates
void pushUsefulPredicates(Optimizable optTable) throws StandardException(Code)
Determine which predicates in this list are useful for limiting the scan on the given table using its best conglomerate. Remove those predicates from this list and push them down to the given Optimizable table. The predicates are pushed down in the order of the index columns that they qualify. Also, the predicates are "marked" as start predicates, stop predicates, or qualifier predicates. Finally, the start and stop operators are set in the given Optimizable.
Parameters:
  optTable - An Optimizable for the table in question
exception:
  StandardException - Thrown on error



putOptimizableEqualityPredicateFirst
void putOptimizableEqualityPredicateFirst(Optimizable optTable, int columnNumber) throws StandardException(Code)
Find the optimizable equality predicate on the specified column and make it the first predicate in this list. This is useful for hash joins where Qualifier[0] is assumed to be on the hash key.
Parameters:
  optTable - The optimizable the column comes from.
Parameters:
  columnNumber - The column number within the base table.
exception:
  StandardException - Thrown on error



removeOptPredicate
void removeOptPredicate(int predCtr) throws StandardException(Code)
Remove the OptimizablePredicate at the specified index (0-based) from the list.
Parameters:
  predCtr - The index.
exception:
  StandardException - Thrown on error



sameStartStopPosition
public boolean sameStartStopPosition() throws StandardException(Code)
Can we use the same key for both the start and stop key. This is possible when doing an exact match on an index where there are no other sargable predicates. Whether or not we can use the same key for both the start and stop key.
exception:
  StandardException - Thrown on error



selectivity
public double selectivity(Optimizable optTable) throws StandardException(Code)
calculate the selectivity for a set of predicates. If statistics exist for the predicates this method uses the statistics. If statistics do not exist, then simply call selectivity for each of the predicates and return the result.
Parameters:
  optTable - the Optimizable that the predicate list restricts.



setPredicatesAndProperties
public void setPredicatesAndProperties(OptimizablePredicateList otherList) throws StandardException(Code)
Sets the given list to have the same elements as this one, and the same properties as this one (number of qualifiers and start and stop predicates.
Parameters:
  otherList - The list to set the same as this one.
exception:
  StandardException - Thrown on error



size
public int size()(Code)
Return the number of OptimizablePredicates in the list. integer The number of OptimizablePredicates in the list.



startOperator
int startOperator(Optimizable optTable)(Code)
Get the start operator for the given Optimizable for a heap or index scan.



stopOperator
int stopOperator(Optimizable optTable)(Code)
Get the stop operator for the given Optimizable for a heap or index scan.



transferAllPredicates
public void transferAllPredicates(OptimizablePredicateList otherList) throws StandardException(Code)
Transfer all the predicates from this list to the given list.
exception:
  StandardException - Thrown on error



transferPredicates
public void transferPredicates(OptimizablePredicateList otherList, JBitSet referencedTableMap, Optimizable table) throws StandardException(Code)
Transfer the predicates whose referenced set is contained by the specified referencedTableMap from this list to the other list. This is useful when splitting out a set of predicates from a larger set, like when generating a HashScanResultSet.
Parameters:
  otherList - The predicateList to xfer to
Parameters:
  referencedTableMap - The table map to check against
Parameters:
  table - The table to order the new predicatesagainst
exception:
  StandardException - Thrown on error



useful
boolean useful(Optimizable optTable, ConglomerateDescriptor cd) throws StandardException(Code)
Return true if this predicate list is useful for limiting the scan on the given table using the given conglomerate.
Parameters:
  optTable - An Optimizable for the table in question
Parameters:
  cd - A ConglomerateDescriptor for the conglomerate in question true if this predicate list can limit the scan
exception:
  StandardException - Thrown on error



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