org.apache.directory.server.xdbm.search.impl
Class DefaultOptimizer<E,ID>

java.lang.Object
  extended by org.apache.directory.server.xdbm.search.impl.DefaultOptimizer<E,ID>
All Implemented Interfaces:
Optimizer

public class DefaultOptimizer<E,ID>
extends java.lang.Object
implements Optimizer

Optimizer that annotates the filter using scan counts.

Version:
$Rev: 920097 $
Author:
Apache Directory Project

Constructor Summary
DefaultOptimizer(Store<E,ID> db)
          Creates an optimizer on a database.
 
Method Summary
 java.lang.Long annotate(org.apache.directory.shared.ldap.filter.ExprNode node)
          Annotates the expression tree to determine optimal evaluation order based on the scan count for indices that exist for each expression node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultOptimizer

public DefaultOptimizer(Store<E,ID> db)
                 throws java.lang.Exception
Creates an optimizer on a database.

Parameters:
db - the database this optimizer works for.
Throws:
java.lang.Exception
Method Detail

annotate

public java.lang.Long annotate(org.apache.directory.shared.ldap.filter.ExprNode node)
                        throws java.lang.Exception
Annotates the expression tree to determine optimal evaluation order based on the scan count for indices that exist for each expression node. If an index on the attribute does not exist an IndexNotFoundException will be thrown.

Specified by:
annotate in interface Optimizer
Parameters:
node - the root of the expression node tree
Throws:
java.lang.Exception - if there are failures while optimizing
See Also:
Optimizer.annotate(ExprNode)


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.