[FEAT MERGE]: online optimizer stats gather.

Co-authored-by: obdev <obdev@oceanbase.com>
This commit is contained in:
Monk-Liu
2023-01-28 13:54:38 +08:00
committed by ob-robot
parent 735401c8d7
commit 9484175163
74 changed files with 3416 additions and 85 deletions

View File

@ -43,8 +43,12 @@ int ObExprSysOpOpnsize::calc_sys_op_opnsize_expr(const ObExpr &expr, ObEvalCtx &
if (OB_FAIL(expr.eval_param_value(ctx, arg))) {
LOG_WARN("eval param failed", K(ret));
} else {
int64_t size = sizeof(*arg) + (arg->is_null() ? 0 : arg->len_);
res.set_int(size);
int64_t size = 0;
if (OB_FAIL(calc_sys_op_opnsize(arg, size))) {
LOG_WARN("fail to cal sys_op_opnsize", K(ret));
} else {
res.set_int(size);
}
}
return ret;
}
@ -59,5 +63,16 @@ int ObExprSysOpOpnsize::cg_expr(ObExprCGCtx &expr_cg_ctx, const ObRawExpr &raw_e
return ret;
}
int ObExprSysOpOpnsize::calc_sys_op_opnsize(ObDatum *arg, int64_t &size) {
int ret = OB_SUCCESS;
if (OB_ISNULL(arg)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null pointer", K(ret));
} else {
size = sizeof(*arg) + (arg->is_null() ? 0 : arg->len_);
}
return ret;
}
} /* namespace sql */
} /* namespace oceanbase */

View File

@ -33,6 +33,7 @@ public:
ObExpr &rt_expr) const override;
static int calc_sys_op_opnsize_expr(const ObExpr &expr, ObEvalCtx &ctx,
ObDatum &res);
static int calc_sys_op_opnsize(ObDatum *arg, int64_t &size);
private:
DISALLOW_COPY_AND_ASSIGN(ObExprSysOpOpnsize);
};