Package org.voltdb.planner.parseinfo

Examples of org.voltdb.planner.parseinfo.StmtTableScan


                String expressionjson = index.getExpressionsjson();
                if (expressionjson.isEmpty()) {
                    continue;
                }
                List<AbstractExpression> indexedExprs = null;
                StmtTableScan tableScan = new StmtTargetTableScan(srcTable, srcTable.getTypeName());
                try {
                    indexedExprs = AbstractExpression.fromJSONArrayString(expressionjson, tableScan);
                } catch (JSONException e) {
                    e.printStackTrace();
                    assert(false);
View Full Code Here


            return false;
        }
        boolean allScansAreDeterministic = true;
        for (Entry<String, List<AbstractExpression>> orderedAlias : baseTableAliases.entrySet()) {
            List<AbstractExpression> orderedAliasExprs = orderedAlias.getValue();
            StmtTableScan tableScan = m_tableAliasMap.get(orderedAlias.getKey());
            if (tableScan == null) {
                assert(false);
                return false;
            }
View Full Code Here

            return checkPureColumnIndex(index, ((TupleValueExpression)aggExpr).getColumnIndex(), filterExprs);

        } else {
            // either pure expression index or mix of expressions and simple columns
            List<AbstractExpression> indexedExprs = null;
            StmtTableScan tableScan = m_parsedStmt.m_tableAliasMap.get(fromTableAlias);

            try {
                indexedExprs = AbstractExpression.fromJSONArrayString(exprsjson, tableScan);
            } catch (JSONException e) {
                e.printStackTrace();
View Full Code Here

        String tableAlias = exprNode.attributes.get("tablealias");
        if (tableAlias == null) {
            tableAlias = tableName;
        }
        StmtTableScan tableScan = m_tableAliasMap.get(tableAlias);
        assert(tableScan != null);
        String columnName = exprNode.attributes.get("column");
        String columnAlias = exprNode.attributes.get("alias");
        TupleValueExpression expr = new TupleValueExpression(tableName, tableAlias, columnName, columnAlias);
        // Collect the unique columns used in the plan for a given scan.
        // Resolve the tve and add it to the scan's cache of referenced columns
        tableScan.resolveTVE(expr, columnName);
        return expr;
    }
View Full Code Here

     * @param subQuery
     * @return index into the cache array
     */
    private StmtTableScan addTableToStmtCache(String tableName, String tableAlias, AbstractParsedStmt subquery) {
        // Create an index into the query Catalog cache
        StmtTableScan tableScan = m_tableAliasMap.get(tableAlias);
        if (tableScan == null) {
            if (subquery == null) {
                tableScan = new StmtTargetTableScan(getTableFromDB(tableName), tableAlias);
            } else {
                tableScan = new StmtSubqueryScan(subquery, tableAlias);
View Full Code Here

        }

        // add table to the query cache before processing the JOIN/WHERE expressions
        // The order is important because processing sub-query expressions assumes that
        // the sub-query is already registered
        StmtTableScan tableScan = addTableToStmtCache(tableName, tableAlias, subquery);

        AbstractExpression joinExpr = parseJoinCondition(tableNode);
        AbstractExpression whereExpr = parseWhereCondition(tableNode);

        // The join type of the leaf node is always INNER
View Full Code Here

        // try to generate and add a simpler access path using the same index,
        // this time with the inner-outer expressions used only as non-indexable post-filters.

        // Don't bother generating these redundant or inferior access paths unless there is
        // an inner-outer expression and a chance that NLIJ will be taken out of the running.
        StmtTableScan innerTable = innerChildNode.getTableScan();
        assert(innerTable != null);
        boolean mayNeedInnerSendReceive = ( ! m_partitioning.wasSpecifiedAsSingle()) &&
                (m_partitioning.getCountOfPartitionedTables() > 0) &&
                (parentNode.getJoinType() != JoinType.INNER) &&
                ! innerTable.getIsReplicated();
// too expensive/complicated to test here? (parentNode.m_leftNode has a replicated result?) &&

        if (mayNeedInnerSendReceive && ! parentNode.m_joinInnerOuterList.isEmpty()) {
            List<AccessPath> innerOuterAccessPaths = new ArrayList<AccessPath>();
            for (AccessPath innerAccessPath : innerChildNode.m_accessPaths) {
View Full Code Here

            return plan;
        }

        // got here? we're got ourselves a sequential scan over a real table
        assert (scanNode.getChildCount() == 0);
        StmtTableScan tableScan = scanNode.getTableScan();
        assert(tableScan != null);

        Index indexToScan = null;

        // Pick the narrowest index from all of the unique tree indexes.
        // note: This is not the same as picking the narrowest key in c++,
        // which is probably what you want if it turns out this optimization
        // does anything for performance at all.
        for (Index index : tableScan.getIndexes()) {
            // skip non-unique indexes
            if (index.getUnique() == false) {
                continue;
            }
            // skip hash indexes
View Full Code Here

     * @param table The table to get data from.
     * @param path The access path to access the data in the table (index/scan/etc).
     * @return The root of a plan graph to get the data.
     */
    protected static AbstractPlanNode getAccessPlanForTable(JoinNode tableNode) {
        StmtTableScan tableScan = tableNode.getTableScan();
        AccessPath path = tableNode.m_currentAccessPath;
        assert(path != null);

        AbstractPlanNode scanNode = null;
        // if no path is a sequential scan, call a subroutine for that
View Full Code Here

            }
            subAssembler = new SelectSubPlanAssembler(m_catalogDb, m_parsedSelect, m_partitioning);

            // Process the GROUP BY information, decide whether it is group by the partition column
            for (ParsedColInfo groupbyCol: m_parsedSelect.m_groupByColumns) {
                StmtTableScan scanTable = m_parsedSelect.m_tableAliasMap.get(groupbyCol.tableAlias);
                // table alias may be from "VOLT_TEMP_TABLE".
                if (scanTable != null && scanTable.getPartitioningColumns() != null) {
                    for (SchemaColumn pcol : scanTable.getPartitioningColumns()) {
                        if  (pcol != null && pcol.getColumnName().equals(groupbyCol.columnName) ) {
                            m_parsedSelect.setHasPartitionColumnInGroupby();
                            break;
                        }
                    }
View Full Code Here

TOP

Related Classes of org.voltdb.planner.parseinfo.StmtTableScan

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.