Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.sql.compile
Interface OptimizablePredicate  view OptimizablePredicate download OptimizablePredicate.java


public interface OptimizablePredicate

OptimizablePredicate provides services for optimizing predicates in a query.


Method Summary
 boolean compareWithKnownConstant(Optimizable optTable, boolean considerParameters)
          Is this predicate a comparison with a known constant value?
 boolean equalsComparisonWithConstantExpression(Optimizable optTable)
          Is this predicate an equality comparison with a constant expression? (IS NULL is considered to be an = comparison with a constant expression).
 org.apache.derby.iapi.types.DataValueDescriptor getCompareValue(Optimizable optTable)
          Get an Object representing the known constant value that the given Optimizable is being compared to.
 int getIndexPosition()
          Get the position of the index column that this predicate restricts.
 org.apache.derby.iapi.util.JBitSet getReferencedMap()
          Get the map of referenced tables for this OptimizablePredicate.
 int hasEqualOnColumnList(int[] baseColumnPositions, Optimizable optTable)
          Returns if the predicate involves an equal operator on one of the columns specified in the baseColumnPositions.
 boolean hasMethodCall()
          Return whether or not an OptimizablePredicate contains a method call.
 boolean hasSubquery()
          Return whether or not an OptimizablePredicate contains a subquery.
 boolean isQualifier()
          Is this predicate a qualifier?
 boolean isStartKey()
          Is this predicate a start key?
 boolean isStopKey()
          Is this predicate a stop key?
 void markQualifier()
          Tell the predicate that it is to be used as a qualifier in an index scan.
 void markStartKey()
          Tell the predicate that it is to be used as a column in the start key value for an index scan.
 void markStopKey()
          Tell the predicate that it is to be used as a column in the stop key value for an index scan.
 double selectivity(Optimizable optTable)
          Get a (crude) estimate of the selectivity of this predicate.
 

Method Detail

getReferencedMap

public org.apache.derby.iapi.util.JBitSet getReferencedMap()
Get the map of referenced tables for this OptimizablePredicate.


hasSubquery

public boolean hasSubquery()
Return whether or not an OptimizablePredicate contains a subquery.


hasMethodCall

public boolean hasMethodCall()
Return whether or not an OptimizablePredicate contains a method call.


markStartKey

public void markStartKey()
Tell the predicate that it is to be used as a column in the start key value for an index scan.


isStartKey

public boolean isStartKey()
Is this predicate a start key?


markStopKey

public void markStopKey()
Tell the predicate that it is to be used as a column in the stop key value for an index scan.


isStopKey

public boolean isStopKey()
Is this predicate a stop key?


markQualifier

public void markQualifier()
Tell the predicate that it is to be used as a qualifier in an index scan.


isQualifier

public boolean isQualifier()
Is this predicate a qualifier?


compareWithKnownConstant

public boolean compareWithKnownConstant(Optimizable optTable,
                                        boolean considerParameters)
Is this predicate a comparison with a known constant value?


getCompareValue

public org.apache.derby.iapi.types.DataValueDescriptor getCompareValue(Optimizable optTable)
                                                                throws org.apache.derby.iapi.error.StandardException
Get an Object representing the known constant value that the given Optimizable is being compared to.


equalsComparisonWithConstantExpression

public boolean equalsComparisonWithConstantExpression(Optimizable optTable)
Is this predicate an equality comparison with a constant expression? (IS NULL is considered to be an = comparison with a constant expression).


hasEqualOnColumnList

public int hasEqualOnColumnList(int[] baseColumnPositions,
                                Optimizable optTable)
                         throws org.apache.derby.iapi.error.StandardException
Returns if the predicate involves an equal operator on one of the columns specified in the baseColumnPositions.


selectivity

public double selectivity(Optimizable optTable)
Get a (crude) estimate of the selectivity of this predicate. This is to be used when no better technique is available for estimating the selectivity - this method's estimate is a hard- wired number based on the type of predicate and the datatype (the selectivity of boolean is always 50%).


getIndexPosition

public int getIndexPosition()
Get the position of the index column that this predicate restricts. NOTE: This assumes that this predicate is part of an OptimizablePredicateList, and that classify() has been called on the OptimizablePredicateList.