Package com.foundationdb.server.explain

Examples of com.foundationdb.server.explain.ExplainContext


        return withIndentedExplain(new StringBuilder(super.summaryString()), null, null, DefaultFormatter.LevelOfDetail.VERBOSE_WITHOUT_COST);
    }

    protected String withIndentedExplain(StringBuilder str, ExplainContext context, String defaultSchemaName, DefaultFormatter.LevelOfDetail levelOfDetail) {
        if (context == null)
            context = new ExplainContext(); // Empty
        DefaultFormatter f = new DefaultFormatter(defaultSchemaName, levelOfDetail);
        for (String operator : f.format(plannable.getExplainer(context))) {
            str.append("\n  ");
            str.append(operator);
        }
View Full Code Here


        UpdateFunction updateFunction =
                new UpsertRowUpdateFunction(Arrays.asList(updates), stream.rowType);
        stream.operator = API.update_Returning(stream.operator, updateFunction);
       
        if (logger.isDebugEnabled()) {
            ExplainContext explain = explainUpdateStatement(stream.operator, table, Arrays.asList(updates));
            DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());
            logger.debug("Update Plan for {}:\n{}", table,
                         join(formatter.format(stream.operator.getExplainer(explain))));
        }
        return stream.operator;
View Full Code Here

    }

   
    protected ExplainContext explainUpdateStatement(Operator plan, Table table, List<TPreparedExpression> updatesP) {
       
        ExplainContext explainContext = new ExplainContext();       
        Attributes atts = new Attributes();
        atts.put(Label.TABLE_SCHEMA, PrimitiveExplainer.getInstance(table.getName().getSchemaName()));
        atts.put(Label.TABLE_NAME, PrimitiveExplainer.getInstance(table.getName().getTableName()));
        for (Column column : table.getColumns()) {
            if (updatesP.get(column.getPosition()) != null) {
                atts.put(Label.COLUMN_NAME, PrimitiveExplainer.getInstance(column.getName()));
                atts.put(Label.EXPRESSIONS, updatesP.get(column.getPosition()).getExplainer(explainContext));
            }
        }
        explainContext.putExtraInfo(plan, new CompoundExplainer(Type.EXTRA_INFO, atts));
        return explainContext;
    }
View Full Code Here

        });
        plan = API.filter_Default(plan, keepTypes);

        if (logger.isDebugEnabled()) {
            DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());
            logger.debug("Scan Plan for {}:\n{}", table, join(formatter.format(plan.getExplainer(new ExplainContext()))));

        }

        return plan;
       
View Full Code Here

                                                API.InputPreservationOption.DISCARD_INPUT, 1);
                                       
        if (logger.isDebugEnabled()) {
            DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());
            logger.debug("Branch Plan for {}:\n{}", table,
                         join(formatter.format(plan.getExplainer(new ExplainContext()))));
        }
        return plan;
    }
View Full Code Here

                API.InputPreservationOption.DISCARD_INPUT,
                1);
        if (logger.isDebugEnabled()) {
            DefaultFormatter formatter = new DefaultFormatter(table.getName().getSchemaName());
            logger.debug("Ancestor Plan for {}:\n{}", table,
                         join(formatter.format(lookup.getExplainer(new ExplainContext()))));
        }
        return lookup;
    }
View Full Code Here

                plan.updatePositions[i] = foreignKey.getReferencingColumns().get(i).getPosition();
            }
            plan.plannable = API.update_Default(input, plan);
        }
        if (LOG.isDebugEnabled()) {
            ExplainContext context = new ExplainContext();
            Attributes atts = new Attributes();
            TableName tableName = foreignKey.getReferencingTable().getName();
            atts.put(Label.TABLE_SCHEMA,
                     PrimitiveExplainer.getInstance(tableName.getSchemaName()));
            atts.put(Label.TABLE_NAME,
                     PrimitiveExplainer.getInstance(tableName.getTableName()));
            for (int i = 0; i < plan.ncols; i++) {
                atts.put(Label.COLUMN_NAME,
                         PrimitiveExplainer.getInstance(foreignKey.getReferencingColumns().get(i).getName()));
                CompoundExplainer var = new CompoundExplainer(Type.VARIABLE);
                var.addAttribute(Label.BINDING_POSITION,
                                 PrimitiveExplainer.getInstance(plan.ncols + i));
                atts.put(Label.EXPRESSIONS, var);
            }
            context.putExtraInfo(plan.plannable,
                                 new CompoundExplainer(Type.EXTRA_INFO, atts));
            Explainer explainer = plan.plannable.getExplainer(context);
            LOG.debug("Plan for " + foreignKey.getConstraintName().getTableName() + ":\n" +
                      Strings.join(new DefaultFormatter(tableName.getSchemaName()).format(explainer)));
        }
View Full Code Here

        );
    }

    protected String getExplain (Operator plannable, String defaultSchemaName) {
        StringBuilder str = new StringBuilder();
        ExplainContext context = new ExplainContext(); // Empty
        DefaultFormatter f = new DefaultFormatter(defaultSchemaName);
        for (String operator : f.format(plannable.getExplainer(context))) {
            if(str.length() > 0) {
                str.append("\n");
            }
View Full Code Here

                "      IndexScan_Default(Index(c.PRIMARY), __row_id = $1)");
    }

    protected String getExplain (Operator plannable, String defaultSchemaName) {
        StringBuilder str = new StringBuilder();
        ExplainContext context = new ExplainContext(); // Empty
        DefaultFormatter f = new DefaultFormatter(defaultSchemaName);
        for (String operator : f.format(plannable.getExplainer(context))) {
            str.append("\n  ");
            str.append(operator);
        }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.explain.ExplainContext

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.