Files
oceanbase/src/sql/optimizer/ob_log_monitoring_dump.cpp
wangzelin.wzl 93a1074b0c patch 4.0
2022-10-24 17:57:12 +08:00

68 lines
1.7 KiB
C++

/**
* Copyright (c) 2021 OceanBase
* OceanBase CE is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PubL v2 for more details.
*/
#define USING_LOG_PREFIX SQL_OPT
#include "sql/optimizer/ob_log_monitoring_dump.h"
#include "sql/optimizer/ob_optimizer_util.h"
#include "ob_opt_est_cost.h"
#include "ob_select_log_plan.h"
using namespace oceanbase;
using namespace sql;
using namespace oceanbase::common;
namespace oceanbase
{
namespace sql
{
const char *ObLogMonitoringDump::get_name() const
{
static const char *monitoring_name_[1] =
{
"MONITORING DUMP",
};
return monitoring_name_[0];
}
int ObLogMonitoringDump::print_my_plan_annotation(char *buf,
int64_t &buf_len,
int64_t &pos,
ExplainType type)
{
int ret = OB_SUCCESS;
// print access
UNUSED(buf);
UNUSED(buf_len);
UNUSED(pos);
UNUSED(type);
return ret;
}
int ObLogMonitoringDump::est_cost()
{
int ret = OB_SUCCESS;
ObLogicalOperator *child = NULL;
if (OB_ISNULL(child = get_child(first_child))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(child), K(ret));
} else {
set_op_cost(0.0);
set_cost(op_cost_ + child->get_cost());
set_card(child->get_card());
}
return ret;
}
}
}