const _PlanOperation *_PlanOperation::execute() { epoch_t startTime = get_epoch_nanoseconds(); refreshInput(); setupPlanOperation(); PapiTracer pt; pt.addEvent("PAPI_TOT_CYC"); pt.addEvent(getEvent()); pt.start(); executePlanOperation(); pt.stop(); teardownPlanOperation(); epoch_t endTime = get_epoch_nanoseconds(); std::string threadId = boost::lexical_cast<std::string>(std::this_thread::get_id()); if (_performance_attr != nullptr) *_performance_attr = (performance_attributes_t) { pt.value("PAPI_TOT_CYC"), pt.value(getEvent()), getEvent() , planOperationName(), _operatorId, startTime, endTime, threadId }; setState(OpSuccess); return this; }
const PlanOperation* PlanOperation::execute() { const bool recordPerformance = _performance_attr != nullptr; // Check if we really need this epoch_t startTime = 0; if (recordPerformance) startTime = get_epoch_nanoseconds(); PapiTracer pt; // Start the execution refreshInput(); setupPlanOperation(); if (recordPerformance) { pt.addEvent("PAPI_TOT_CYC"); pt.addEvent(getEvent()); pt.start(); } executePlanOperation(); if (recordPerformance) pt.stop(); teardownPlanOperation(); if (recordPerformance) { epoch_t endTime = get_epoch_nanoseconds(); std::string threadId = boost::lexical_cast<std::string>(std::this_thread::get_id()); size_t cardinality; if (getResultTable() != empty_result) cardinality = getResultTable()->size(); else // the cardinality is max(size_t) by convention if there is no return table cardinality = std::numeric_limits<size_t>::max(); *_performance_attr = (performance_attributes_t) {pt.value("PAPI_TOT_CYC"), pt.value(getEvent()), getEvent(), planOperationName(), _operatorId, startTime, endTime, threadId, cardinality}; } setState(OpSuccess); return this; }