org.axiondb.engine.commands
Class AxionQueryPlanner

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

public class AxionQueryPlanner
extends Object

Query Planner to be used in select and sub-select Query. I optimize the based on the situation to choose the best fit RowIterator.

Current Goal

****************************************************************

TODO: Take advantage of Index for MIN/MAX - The first and last values represent MIN and MAX values respectively for asending indexes.

TODO : Optimize OrderBy (Take advantage of index if available)

TODO : Optimize Group By, may be we can make use of Index here too.

TODO: Take advantage of Index for LIKE operator.

TODO: Consolidate the process of applying Aggregate function with or without group by

TODO: Some kind of cost based optimization might help the planner to decide which join algo to use and in which order/sequence join should be perfermed. We have access to rowcount thru table.getRowCount()

TODO: Throw exception with proper message if aggregate function used in Where clause. (e.g. group function is not allowed here)

****************************************************************

Future Goal

TODO: Reducing Multi-Block queries to Single Block - Folding correlated sub-query to outer query where possible or use SemiJoin like technique for optimizing Muti-Block queries.

TODO: Make AxionQueryPlanNode rich and Introduce AxionPlanContext to capture the plan and excute later, so that we can re-adjust the plannode later. e.g the Rows might have already sorted on the order by key, so we don't have to sort again. Eleminating this duplicate sort can be done after building plan nodes.

TODO: Projection - For now its ok to pass the entire rowIterator to the resultset, but at some point we need to project only required columns.

TODO: Handle situation where we have mutiple index avaiable for the join condition

TODO: Query Rewrite may not be that deficult for Axion, But this could dramatically reduce the cost of query execution and help planner to produce a better plan.

TODO: System-R Optimizer, Materialized View etc. are far cry, but someone could give it a try.

Version:
$Revision: 1.14 $ $Date: 2004/08/29 06:03:05 $

Constructor Summary
AxionQueryPlanner(AxionQueryContext context)
           
 
Method Summary
 Map getColumnIdToFieldMap()
           
 RowIterator getPlanNodeRowIterator()
           
 RowIterator makeRowIterator(Database db)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxionQueryPlanner

public AxionQueryPlanner(AxionQueryContext context)
Method Detail

getColumnIdToFieldMap

public Map getColumnIdToFieldMap()

getPlanNodeRowIterator

public RowIterator getPlanNodeRowIterator()

makeRowIterator

public RowIterator makeRowIterator(Database db)
                            throws AxionException
Throws:
AxionException