Package com.foundationdb.sql.optimizer.rule.range

Examples of com.foundationdb.sql.optimizer.rule.range.ColumnRanges


                                                        selector,
                                                        rulesContext.getPipelineConfiguration().getIndexScanLookaheadQuantum());
                stream.rowType = indexRowType;
            }
            else {
                ColumnRanges range = indexScan.getConditionRange();
                // Non-single-point ranges are ordered by the ranges
                // themselves as part of merging segments, so that index
                // column is an ordering column.
                // Single-point ranges have only one value for the range column,
                // so they can order by the following columns if we're
                // willing to do the more expensive ordered union.
                // Determine whether anything is taking advantage of this:
                // * Index is being intersected.
                // * Index is effective for query ordering.
                // ** See also special case in AggregateSplitter.directIndexMinMax().
                boolean unionOrdered = false, unionOrderedAll = false;
                if (range.isAllSingle()) {
                    if (forIntersection != IntersectionMode.NONE) {
                        unionOrdered = true;
                        if (forIntersection == IntersectionMode.OUTPUT) {
                            unionOrderedAll = true;
                        }
                    }
                    else if (indexScan.getOrderEffectiveness() != IndexScan.OrderEffectiveness.NONE) {
                        unionOrderedAll = unionOrdered = true;
                    }
                }
                for (RangeSegment rangeSegment : range.getSegments()) {
                    Operator scan = API.indexScan_Default(indexRowType,
                                                          assembleIndexKeyRange(indexScan, null, rangeSegment),
                                                          assembleIndexOrdering(indexScan, indexRowType),
                                                          selector,
                                                          rulesContext.getPipelineConfiguration().getIndexScanLookaheadQuantum());
View Full Code Here


                            foundInequalityCondition = true;
                        }
                    }
                }
                if (!foundInequalityCondition) {
                    ColumnRanges range = rangeForIndex(indexExpression);
                    if (range != null)
                        index.addRangeCondition(range);
                }
            }
        }
View Full Code Here

    protected ColumnRanges rangeForIndex(ExpressionNode expressionNode) {
        if (expressionNode instanceof ColumnExpression) {
            if (columnsToRanges == null) {
                columnsToRanges = new HashMap<>();
                for (ConditionExpression condition : conditions) {
                    ColumnRanges range = ColumnRanges.rangeAtNode(condition);
                    if (range != null) {
                        ColumnExpression rangeColumn = range.getColumnExpression();
                        ColumnRanges oldRange = columnsToRanges.get(rangeColumn);
                        if (oldRange != null)
                            range = ColumnRanges.andRanges(range, oldRange);
                        columnsToRanges.put(rangeColumn, range);
                    }
                }
View Full Code Here

TOP

Related Classes of com.foundationdb.sql.optimizer.rule.range.ColumnRanges

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.