org.modeshape.jcr.query.optimize

## Class AddIndexes

- java.lang.Object
- - org.modeshape.jcr.query.optimize.AddIndexes

- All Implemented Interfaces:
    OptimizerRule

      @Immutable
      public class AddIndexes
      extends Object
      implements OptimizerRule

  A rule that adds indexes below `PlanNode.Type.SOURCE` nodes. The rule uses an `IndexPlanner` that will actually look at the AND-ed constraints for the source (that is, the constraints in the `PlanNode.Type.SELECT` above the `PlanNode.Type.SOURCE` node but below an `PlanNode.Type.ACCESS` node) and produce 0 or more indexes. These indexes are then added as `PlanNode.Type.INDEX` nodes below the `PlanNode.Type.SOURCE` node.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AddIndexes(IndexPlanners planner)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PlanNode` | `execute(QueryContext context, PlanNode plan, LinkedList<OptimizerRule> ruleStack)` Optimize the supplied plan using the supplied context, hints, and yet-to-be-run rules.
    `static AddIndexes` | `implicitIndexes()` The instance of the rule that uses the implicit indexes, like those for finding nodes (or children or descendants) based upon a path.
    `static AddIndexes` | `with(IndexPlanners planners)` The instance of the rule that uses the supplied index planner.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AddIndexes

          protected AddIndexes(IndexPlanners planner)

  - ### Method Detail

    - #### implicitIndexes

          public static AddIndexes implicitIndexes()

      The instance of the rule that uses the implicit indexes, like those for finding nodes (or children or descendants) based upon a path.
      Returns:
        the rule; never null

    - #### with

          public static AddIndexes with(IndexPlanners planners)

      The instance of the rule that uses the supplied index planner.
      Parameters:
        `planners` - the index planners; should not be null
      Returns:
        the new rule; never null

    - #### execute

          public PlanNode execute(QueryContext context,
                         PlanNode plan,
                         LinkedList<OptimizerRule> ruleStack)

      Description copied from interface: `OptimizerRule`
      Optimize the supplied plan using the supplied context, hints, and yet-to-be-run rules.
      Specified by:
        `execute` in interface `OptimizerRule`
      Parameters:
        `context` - the context in which the query is being optimized; never null
        `plan` - the plan to be optimized; never null
        `ruleStack` - the stack of rules that will be run after this rule; never null
      Returns:
        the optimized plan; never null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.