optimize performance
This commit is contained in:
@ -212,15 +212,12 @@ int ObQueryDriver::response_query_result(ObResultSet &result,
|
||||
// break;
|
||||
} else {
|
||||
LOG_DEBUG("response row succ", K(*row));
|
||||
ObArenaAllocator *allocator = NULL;
|
||||
if (OB_FAIL(result.get_exec_context().get_convert_charset_allocator(allocator))) {
|
||||
LOG_WARN("fail to get lob fake allocator", K(ret));
|
||||
} else if (OB_NOT_NULL(allocator)) {
|
||||
allocator->reset_remain_one_page();
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
++row_num;
|
||||
if (0 == row_num % RESET_CONVERT_CHARSET_ALLOCATOR_EVERY_X_ROWS) {
|
||||
(void) result.get_exec_context().try_reset_convert_charset_allocator();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,6 +37,8 @@ class ObMySQLResultSet;
|
||||
class ObQueryRetryCtrl;
|
||||
class ObQueryDriver
|
||||
{
|
||||
public:
|
||||
static const int64_t RESET_CONVERT_CHARSET_ALLOCATOR_EVERY_X_ROWS = 32;
|
||||
public:
|
||||
ObQueryDriver(const ObGlobalContext &gctx,
|
||||
const sql::ObSqlCtx &ctx,
|
||||
|
||||
@ -638,6 +638,13 @@ int ObExecContext::get_convert_charset_allocator(ObArenaAllocator *&allocator)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ObExecContext::try_reset_convert_charset_allocator()
|
||||
{
|
||||
if (OB_NOT_NULL(convert_allocator_)) {
|
||||
convert_allocator_->reset_remain_one_page();
|
||||
}
|
||||
}
|
||||
|
||||
int ObExecContext::get_udf_ctx_mgr(ObUdfCtxMgr *&udf_ctx_mgr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -159,6 +159,7 @@ public:
|
||||
void reset_expr_op();
|
||||
inline bool is_expr_op_ctx_inited() { return expr_op_size_ > 0 && NULL != expr_op_ctx_store_; }
|
||||
int get_convert_charset_allocator(common::ObArenaAllocator *&allocator);
|
||||
void try_reset_convert_charset_allocator();
|
||||
|
||||
void destroy_eval_allocator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user