Search in sources :

Example 1 with MergeNode

use of com.actiontech.dble.plan.node.MergeNode in project dble by actiontech.

the class LimitPusher method findChild.

private static PlanNode findChild(PlanNode qtn) {
    if (qtn instanceof MergeNode) {
        // optimizer limit
        // union: push down limit to children
        // union all:push down limit to children and add distinct
        MergeNode node = (MergeNode) qtn;
        long limitFrom = node.getLimitFrom();
        long limitTo = node.getLimitTo();
        if (limitFrom != -1 && limitTo != -1) {
            for (PlanNode child : node.getChildren()) {
                pushLimit(child, limitFrom, limitTo, node.isUnion());
            }
        }
    } else if ((qtn instanceof JoinNode) || (qtn instanceof QueryNode)) {
        for (PlanNode child : qtn.getChildren()) {
            findChild(child);
        }
    }
    return qtn;
}
Also used : MergeNode(com.actiontech.dble.plan.node.MergeNode) PlanNode(com.actiontech.dble.plan.node.PlanNode) JoinNode(com.actiontech.dble.plan.node.JoinNode) QueryNode(com.actiontech.dble.plan.node.QueryNode)

Aggregations

JoinNode (com.actiontech.dble.plan.node.JoinNode)1 MergeNode (com.actiontech.dble.plan.node.MergeNode)1 PlanNode (com.actiontech.dble.plan.node.PlanNode)1 QueryNode (com.actiontech.dble.plan.node.QueryNode)1