@Immutable public class ReorderSortAndRemoveDuplicates extends Object implements OptimizerRule
optimizer rule
that looks for a PlanNode.Type.SORT
plan node below a PlanNode.Type.DUP_REMOVE
, and swaps
them. This ensures that the duplicate removal is always lower in the tree. This is advantageous because many sort algorithms
can also efficiently remove duplicates, so it is often better for the PlanNode.Type.SORT
plan node to appear higher in the
optimized plan.Modifier and Type | Field and Description |
---|---|
static ReorderSortAndRemoveDuplicates |
INSTANCE |
Constructor and Description |
---|
ReorderSortAndRemoveDuplicates() |
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.
|
String |
toString() |
public static final ReorderSortAndRemoveDuplicates INSTANCE
public PlanNode execute(QueryContext context, PlanNode plan, LinkedList<OptimizerRule> ruleStack)
OptimizerRule
execute
in interface OptimizerRule
context
- the context in which the query is being optimized; never nullplan
- the plan to be optimized; never nullruleStack
- the stack of rules that will be run after this rule; never nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.