mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Added THD argument to select_result and all derivative classes. This reduces number of pthread_getspecific calls from 796 to 776 per OLTP RO transaction.
This commit is contained in:
@@ -71,8 +71,8 @@ class Select_materialize: public select_union
|
||||
select_result *result; /**< the result object of the caller (PS or SP) */
|
||||
public:
|
||||
Materialized_cursor *materialized_cursor;
|
||||
Select_materialize(select_result *result_arg)
|
||||
:result(result_arg), materialized_cursor(0) {}
|
||||
Select_materialize(THD *thd_arg, select_result *result_arg):
|
||||
select_union(thd_arg), result(result_arg), materialized_cursor(0) {}
|
||||
virtual bool send_result_set_metadata(List<Item> &list, uint flags);
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ int mysql_open_cursor(THD *thd, select_result *result,
|
||||
LEX *lex= thd->lex;
|
||||
int rc;
|
||||
|
||||
if (! (result_materialize= new (thd->mem_root) Select_materialize(result)))
|
||||
if (!(result_materialize= new (thd->mem_root) Select_materialize(thd, result)))
|
||||
return 1;
|
||||
|
||||
save_result= lex->result;
|
||||
|
||||
Reference in New Issue
Block a user