本文整理汇总了C++中SeqScanPlanNode::debug方法的典型用法代码示例。如果您正苦于以下问题:C++ SeqScanPlanNode::debug方法的具体用法?C++ SeqScanPlanNode::debug怎么用?C++ SeqScanPlanNode::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SeqScanPlanNode
的用法示例。
在下文中一共展示了SeqScanPlanNode::debug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: p_execute
bool SeqScanExecutor::p_execute(const NValueArray ¶ms, ReadWriteTracker *tracker) {
SeqScanPlanNode* node = dynamic_cast<SeqScanPlanNode*>(abstract_node);
assert(node);
Table* output_table = node->getOutputTable();
assert(output_table);
Table* target_table = dynamic_cast<Table*>(node->getTargetTable());
assert(target_table);
//cout << "SeqScanExecutor: node id" << node->getPlanNodeId() << endl;
VOLT_TRACE("Sequential Scanning table :\n %s",
target_table->debug().c_str());
VOLT_DEBUG("Sequential Scanning table : %s which has %d active, %d"
" allocated tuples",
target_table->name().c_str(),
(int)target_table->activeTupleCount(),
(int)target_table->allocatedTupleCount());
//
// OPTIMIZATION: NESTED PROJECTION
//
// Since we have the input params, we need to call substitute to
// change any nodes in our expression tree to be ready for the
// projection operations in execute
//
int num_of_columns = (int)output_table->columnCount();
ProjectionPlanNode* projection_node = dynamic_cast<ProjectionPlanNode*>(node->getInlinePlanNode(PLAN_NODE_TYPE_PROJECTION));
if (projection_node != NULL) {
for (int ctr = 0; ctr < num_of_columns; ctr++) {
assert(projection_node->getOutputColumnExpressions()[ctr]);
projection_node->getOutputColumnExpressions()[ctr]->substitute(params);
}
}
//
// OPTIMIZATION: NESTED LIMIT
// How nice! We can also cut off our scanning with a nested limit!
//
int limit = -1;
int offset = -1;
LimitPlanNode* limit_node = dynamic_cast<LimitPlanNode*>(node->getInlinePlanNode(PLAN_NODE_TYPE_LIMIT));
if (limit_node != NULL) {
limit_node->getLimitAndOffsetByReference(params, limit, offset);
if (offset > 0) {
VOLT_ERROR("Nested Limit Offset is not yet supported for PlanNode"
" '%s'", node->debug().c_str());
return false;
}
}
//
// OPTIMIZATION:
//
// If there is no predicate and no Projection for this SeqScan,
// then we have already set the node's OutputTable to just point
// at the TargetTable. Therefore, there is nothing we more we need
// to do here
//
if (node->getPredicate() != NULL || projection_node != NULL ||
limit_node != NULL)
{
//
// Just walk through the table using our iterator and apply
// the predicate to each tuple. For each tuple that satisfies
// our expression, we'll insert them into the output table.
//
TableTuple tuple(target_table->schema());
TableIterator iterator(target_table);
AbstractExpression *predicate = node->getPredicate();
VOLT_TRACE("SCAN PREDICATE A:\n%s\n", predicate->debug(true).c_str());
if (predicate)
{
predicate->substitute(params);
assert(predicate != NULL);
VOLT_TRACE("SCAN PREDICATE B:\n%s\n",
predicate->debug(true).c_str());
}
int tuple_ctr = 0;
while (iterator.next(tuple))
{
// Read/Write Set Tracking
if (tracker != NULL) {
tracker->markTupleRead(target_table, &tuple);
}
target_table->updateTupleAccessCount();
//tuple.updateTupleAccessFreq() ; //Essam Tuple
VOLT_TRACE("INPUT TUPLE: %s, %d/%d\n",
tuple.debug(target_table->name()).c_str(), tuple_ctr,
(int)target_table->activeTupleCount());
//
// For each tuple we need to evaluate it against our predicate
//
if (predicate == NULL || predicate->eval(&tuple, NULL).isTrue())
{
//
// Nested Projection
// Project (or replace) values from input tuple
//.........这里部分代码省略.........