org.axiondb.engine.commands
Class AxionQueryOptimizer

java.lang.Object
  extended by org.axiondb.engine.commands.AxionQueryOptimizer

public class AxionQueryOptimizer
extends Object

Axion Query Optimizer


Constructor Summary
AxionQueryOptimizer()
           
 
Method Summary
static Function createOneRootFunction(Set conditions)
           
static Set[] decomposeJoinConditionNodes(Set allConditionNodes)
           
static Set[] decomposeWhereConditionNodes(Set allConditionNodes)
           
static EqualFunction findColumnLiteralEqualFunction(TableIdentifier tid, Set conditions)
          find the equal function involving a column and literal This function then can be apply first to restrict the number of rows returned by an iterator.
static ComparisonFunction findFirstEqualFunction(Set joinOnConditionNodes, TableIdentifier tid, Database db)
           
static ComparisonFunction findFirstFunctionUsingIndexedColumn(Set joinOnConditionNodes, TableIdentifier tid, Database db)
           
static Set flatConditionTree(Selectable tree)
          flatten into an ANDed set
static boolean onlyReferencesTable(TableIdentifier table, Selectable node)
           
static Set processWhereTree(Selectable tree)
          Decomposes the given WhereNodeinto a Setof nodes that were originally joined by ANDs, and adds to this set predicates that are implied by the original tree (for example, given A = 1 and A = B, we can infer B = 1.)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxionQueryOptimizer

public AxionQueryOptimizer()
Method Detail

createOneRootFunction

public static Function createOneRootFunction(Set conditions)

decomposeJoinConditionNodes

public static Set[] decomposeJoinConditionNodes(Set allConditionNodes)

decomposeWhereConditionNodes

public static Set[] decomposeWhereConditionNodes(Set allConditionNodes)

findColumnLiteralEqualFunction

public static EqualFunction findColumnLiteralEqualFunction(TableIdentifier tid,
                                                           Set conditions)
find the equal function involving a column and literal This function then can be apply first to restrict the number of rows returned by an iterator. We do this at the index level also.

Parameters:
conditions -
Returns:

flatConditionTree

public static Set flatConditionTree(Selectable tree)
flatten into an ANDed set

Parameters:
tree -
Returns:
flat set of functions which are anded together

onlyReferencesTable

public static boolean onlyReferencesTable(TableIdentifier table,
                                          Selectable node)

processWhereTree

public static Set processWhereTree(Selectable tree)
                            throws AxionException
Decomposes the given WhereNodeinto a Setof nodes that were originally joined by ANDs, and adds to this set predicates that are implied by the original tree (for example, given A = 1 and A = B, we can infer B = 1.)

Throws:
AxionException

findFirstFunctionUsingIndexedColumn

public static ComparisonFunction findFirstFunctionUsingIndexedColumn(Set joinOnConditionNodes,
                                                                     TableIdentifier tid,
                                                                     Database db)
                                                              throws AxionException
Throws:
AxionException

findFirstEqualFunction

public static ComparisonFunction findFirstEqualFunction(Set joinOnConditionNodes,
                                                        TableIdentifier tid,
                                                        Database db)
                                                 throws AxionException
Throws:
AxionException