public class AxionQueryOptimizer
extends java.lang.Object
Constructor and Description |
---|
AxionQueryOptimizer() |
Modifier and Type | Method and Description |
---|---|
static Selectable |
createOneRootFunction(java.util.Set conditions)
Compose back the decomposed condition into a single condition tree.
|
static java.util.Set[] |
decomposeWhereConditionNodes(java.util.Set flattenConditionSet,
boolean isAllInnerJoin)
Decomose a where/join condition into three part: (1) column-column comparision
function (2) column-literal conditions.
|
static java.util.Set |
deriveTableFilter(java.util.Set flattenConditions,
boolean isAllInnerJoin)
Decomposes the given
WhereNode into a Set of 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.) |
static Function |
findColumnLiteralEqualFunction(TableIdentifier tid,
Table table,
java.util.Set conditions,
boolean mustCheckForIndex) |
static Function |
findColumnLiteralFunction(TableIdentifier tid,
Table table,
java.util.Set conditions,
boolean mustCheckForIndex)
Find column-literal comparision function for a given table.
|
static ComparisonFunction |
findFirstColumnColumnComparisonFunction(java.util.Set columnColumnConditions,
TableIdentifier tid,
Table table,
boolean mustCheckForIndex) |
static EqualFunction |
findFirstEqualFunction(java.util.Set columnColumnConditions,
TableIdentifier tid,
Table table,
boolean mustCheckForIndex) |
static java.util.Set |
flatConditionTree(Selectable conditionTree)
Flatten the given condition tree into an ANDed set
|
static Selectable |
getColumnRefersTable(ComparisonFunction fn,
TableIdentifier tid) |
static boolean |
hasTableReference(ComparisonFunction fn,
TableIdentifier tid) |
static boolean |
isAllInnerJoin(java.lang.Object node) |
static Function |
isColumnIndexed(TableIdentifier tid,
Table table,
Selectable condition,
boolean mustCheckForIndex) |
static boolean |
onlyReferencesTable(TableIdentifier table,
Selectable conditionNode)
Check if the given table is the only table refernce in the condition
|
public static Selectable createOneRootFunction(java.util.Set conditions)
conditions
- decomposed condition setpublic static java.util.Set[] decomposeWhereConditionNodes(java.util.Set flattenConditionSet, boolean isAllInnerJoin)
flattenConditionSet
- Flatten Condition Set, created from the where/join
condition, or combined where and join condition setpublic static boolean hasTableReference(ComparisonFunction fn, TableIdentifier tid)
public static Selectable getColumnRefersTable(ComparisonFunction fn, TableIdentifier tid)
public static java.util.Set deriveTableFilter(java.util.Set flattenConditions, boolean isAllInnerJoin) throws AxionException
WhereNode
into a Set
of 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.)flattenConditions
- AxionException
public static Function findColumnLiteralFunction(TableIdentifier tid, Table table, java.util.Set conditions, boolean mustCheckForIndex)
tid
- TableIdentifierconditions
- decomposed condition setpublic static Function findColumnLiteralEqualFunction(TableIdentifier tid, Table table, java.util.Set conditions, boolean mustCheckForIndex)
public static Function isColumnIndexed(TableIdentifier tid, Table table, Selectable condition, boolean mustCheckForIndex)
public static ComparisonFunction findFirstColumnColumnComparisonFunction(java.util.Set columnColumnConditions, TableIdentifier tid, Table table, boolean mustCheckForIndex) throws AxionException
AxionException
public static EqualFunction findFirstEqualFunction(java.util.Set columnColumnConditions, TableIdentifier tid, Table table, boolean mustCheckForIndex) throws AxionException
AxionException
public static java.util.Set flatConditionTree(Selectable conditionTree)
conditionTree
- condition treepublic static boolean onlyReferencesTable(TableIdentifier table, Selectable conditionNode)
table
- TableIdentifierconditionNode
- public static boolean isAllInnerJoin(java.lang.Object node)