Examples of IndexScanPlanNode


Examples of org.voltdb.plannodes.IndexScanPlanNode

        if (indexToScan == null) {
            return plan;
        }

        // make an index node from the scan node
        IndexScanPlanNode indexScanNode = new IndexScanPlanNode(scanNode, null, indexToScan, SortDirectionType.ASC);
        indexScanNode.setForDeterminismOnly();

        return indexScanNode;
    }
View Full Code Here

Examples of org.voltdb.plannodes.IndexScanPlanNode

     */
    protected static AbstractPlanNode getIndexAccessPlanForTable(StmtTableScan tableScan, AccessPath path)
    {
        // now assume this will be an index scan and get the relevant index
        Index index = path.index;
        IndexScanPlanNode scanNode = new IndexScanPlanNode(tableScan, index);
        AbstractPlanNode resultNode = scanNode;
        // set sortDirection here becase it might be used for IN list
        scanNode.setSortDirection(path.sortDirection);
        // Build the list of search-keys for the index in question
        // They are the rhs expressions of the normalized indexExpr comparisons.
        for (AbstractExpression expr : path.indexExprs) {
            AbstractExpression expr2 = expr.getRight();
            assert(expr2 != null);
            if (expr.getExpressionType() == ExpressionType.COMPARE_IN) {
                // Replace this method's result with an injected NLIJ.
                resultNode = injectIndexedJoinWithMaterializedScan(expr2, scanNode);
                // Extract a TVE from the LHS MaterializedScan for use by the IndexScan in its new role.
                MaterializedScanPlanNode matscan = (MaterializedScanPlanNode)resultNode.getChild(0);
                AbstractExpression elemExpr = matscan.getOutputExpression();
                assert(elemExpr != null);
                // Replace the IN LIST condition in the end expression referencing all the list elements
                // with a more efficient equality filter referencing the TVE for each element in turn.
                replaceInListFilterWithEqualityFilter(path.endExprs, expr2, elemExpr);
                // Set up the similar VectorValue --> TVE replacement of the search key expression.
                expr2 = elemExpr;
            }
            scanNode.addSearchKeyExpression(expr2);
        }
        // create the IndexScanNode with all its metadata
        scanNode.setLookupType(path.lookupType);
        scanNode.setBindings(path.bindings);
        scanNode.setEndExpression(ExpressionUtil.combine(path.endExprs));
        scanNode.setPredicate(ExpressionUtil.combine(path.otherExprs));
        // The initial expression is needed to control a (short?) forward scan to adjust the start of a reverse
        // iteration after it had to initially settle for starting at "greater than a prefix key".
        scanNode.setInitialExpression(ExpressionUtil.combine(path.initialExpr));
        scanNode.setSkipNullPredicate();
        return resultNode;
    }
View Full Code Here

Examples of org.voltdb.plannodes.IndexScanPlanNode

        }
        if (pickedUpIndex == null) {
            return root;
        }

        IndexScanPlanNode indexScanNode = new IndexScanPlanNode(
                root, null, pickedUpIndex, SortDirectionType.INVALID);
        indexScanNode.setForGroupingOnly();
        indexScanNode.setBindings(maxCoveredBindings);

        gbInfo.m_coveredGroupByColumns = maxCoveredGroupByColumns;
        gbInfo.m_canBeFullySerialized = foundAllGroupByCoveredIndex;
        return indexScanNode;
    }
View Full Code Here

Examples of org.voltdb.plannodes.IndexScanPlanNode

        assertEquals(tableAlias, ((TupleValueExpression) expr).getTableAlias());
    }

    private void checkIndexScan(AbstractPlanNode indexNode, String tableName, String indexName, String... columns) {
        assertTrue(indexNode instanceof IndexScanPlanNode);
        IndexScanPlanNode idxNode = (IndexScanPlanNode) indexNode;
        if (tableName != null) {
            assertEquals(tableName, idxNode.getTargetTableName());
        }
        if (indexName != null) {
            String actualIndexName = idxNode.getTargetIndexName();
            assertTrue(actualIndexName.contains(indexName));
        }

        checkOutputSchema(idxNode, columns);
    }
View Full Code Here

Examples of org.voltdb.plannodes.IndexScanPlanNode

            assertTrue(pn instanceof OrderByPlanNode);
            pn = pn.getChild(0);
        }
        assertTrue(pn instanceof IndexScanPlanNode);

        IndexScanPlanNode ispn = (IndexScanPlanNode)pn;
        assertTrue(ispn.getTargetIndexName().contains(indexName));
        assertEquals(lookupType, ispn.getLookupType());
        assertEquals(searchKeys, ispn.getSearchKeyExpressions().size());
        assertEquals(endKeys, ExpressionUtil.uncombine(ispn.getEndExpression()).size());
        assertEquals(predicates, ExpressionUtil.uncombine(ispn.getPredicate()).size());

        assertEquals(initials, ExpressionUtil.uncombine(ispn.getInitialExpression()).size());

        // Test artificial post predicate
        if (predicates == 1 && artificial) {
            assertTrue(ispn.getPredicate().getExpressionType() == ExpressionType.OPERATOR_NOT);
            assertTrue(ispn.getPredicate().getLeft().getExpressionType() == ExpressionType.OPERATOR_IS_NULL);
        } else if (predicates > 1) {
            assertTrue(ispn.getPredicate().getExpressionType() == ExpressionType.CONJUNCTION_AND);
        }

        // SortDirection can be INVALID because we use LookupType to determine
        // index scan direction instead in EE.
        assertEquals(sortType, ispn.getSortDirection());
    }
View Full Code Here

Examples of org.voltdb.plannodes.IndexScanPlanNode

            assertTrue(pn instanceof OrderByPlanNode);
            pn = pn.getChild(0);
        }
        assertTrue(pn instanceof IndexScanPlanNode);

        IndexScanPlanNode ispn = (IndexScanPlanNode)pn;
        assertTrue(ispn.getTargetIndexName().contains(indexName));
        assertEquals(lookupType, ispn.getLookupType());
        assertEquals(searchKeys, ispn.getSearchKeyExpressions().size());
        assertEquals(endKeys, ExpressionUtil.uncombine(ispn.getEndExpression()).size());
        assertEquals(predicates, ExpressionUtil.uncombine(ispn.getPredicate()).size());

        assertEquals(0, ExpressionUtil.uncombine(ispn.getInitialExpression()).size());

        assertEquals(sortType, ispn.getSortDirection());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.